Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3065789imu; Sun, 9 Dec 2018 16:29:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/WN0nU0BYToktOslVPDDVoXPlKgGCR5PI4mfUkX6K1o7fO0TTF/voLcYvMa7v+0wiz04RVf X-Received: by 2002:a17:902:9a98:: with SMTP id w24mr10185445plp.213.1544401760152; Sun, 09 Dec 2018 16:29:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544401760; cv=none; d=google.com; s=arc-20160816; b=Xukc3ef3BGCUXAkNJnYEOAH6r3ubY9MsPqaIPybwy+nBp9Jk3uSFMzAE2FDU8m8/am b5jy+r3T5H0M9ErJR2xTs4qg9DOe6/z/zxNRma31NPVBUkNWGQmJAG0JCOlio2ctc6Ok 9DiwVpnBjOWglQLw/TKYbo2cIEyh0xS8fj0TM7a9j7FCQhj5K6ffIerE9EqB4up5fqJN hcB47ckZngq2ppa1ieuvaDW2+dytVIWrCrL7jTyIITuS53W9fC056AA7p5/N6J9PxHDM ZRL0DgBMuEeq99GdH9CGVuTk+lKeKsoF0hV/XWtdeNQgNIvdKmki52M2gEQl4DWsSRGy XygA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=f46699X6wwQdJi0yilADp0D7pszgU5LFLH2thwq7P1Q=; b=t3b85xq7Vtq+8hv4Htvx/eG/tAZotRn1eU37fDVfLpLUu5dvyIqk3bMl3xr0YQS5BG +o+1z4E23HKzgo/XtfR6u44mF5rWZ7fDu7Y3lKNruq4hRLydDrho8elXFKdoW9Yk+Ijj yyIMYh85RJUpf6X9giA1V9T+yZSJCv/xyVe4xunAUk+VQWn0cnOU8cQ64GjuhsTRVKdy FpK51pi7mB4MHFa4K1gvt8qpC4RFSfcyIB29K+lBK60ldyk5Rk772BRhLrn06Ok5uazR lowfcoC5FytnSHOMDpqsiBwNZgPfP63Hv7A4CJ1UcGaPCAq+aYM41NYfQOy5gfJCNSGc gJsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si9078903pfn.212.2018.12.09.16.29.04; Sun, 09 Dec 2018 16:29:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727820AbeLIWGw (ORCPT + 99 others); Sun, 9 Dec 2018 17:06:52 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:37118 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727040AbeLIWGq (ORCPT ); Sun, 9 Dec 2018 17:06:46 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW73C-0002ij-8b; Sun, 09 Dec 2018 21:55:46 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72e-0003Pd-0g; Sun, 09 Dec 2018 21:55:12 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Sagi Grimberg" , "Nicholas Bellinger" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 151/328] iscsi-target: nullify session in failed login sequence In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Sagi Grimberg commit a0b3b9b2409b409c677f7eb1e0485b816a5848f7 upstream. In case login sequence failed, make sure conn->sess is NULL before calling wait_conn as some transports (iser) may rely on that (waiting for session commands). Signed-off-by: Sagi Grimberg Signed-off-by: Nicholas Bellinger Signed-off-by: Ben Hutchings --- drivers/target/iscsi/iscsi_target_login.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -1209,6 +1209,7 @@ void iscsi_target_login_sess_out(struct } kfree(conn->sess->sess_ops); kfree(conn->sess); + conn->sess = NULL; old_sess_out: iscsi_stop_login_thread_timer(np);