Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1485603ybt; Mon, 15 Jun 2020 01:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwW8U3pzszAb6u9ylfrFFO2cQ2Lh2Vasq28aDbMuBvda+uK1jjJqz8H62LMRW/uKOhqbyDC X-Received: by 2002:a17:906:6453:: with SMTP id l19mr23552857ejn.262.1592208840855; Mon, 15 Jun 2020 01:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592208840; cv=none; d=google.com; s=arc-20160816; b=k1MZssq7+IsbJDnCgtMe6Lx4YFHC7BHxIWZDc9q7wPmVJeje1n/MjP6HqFq0/jipn1 yMYbUKuAI2C/gtK0/CHI4kml14fLZk6wL2n3kG3CA+UCdNjwoPZvfRU6rUe5W5/87FDk VrlYNyRK6PHzs27xlwdNWLQ6iC5Kjmb4AXEzA3981QazdMz7l0jmcCna8UxREk+YY6CF Dy+xkBUJXyreb7ekPypcBrMzjFi5RmZMn40L4d9VKjx2Bzm0uUajw0ESzqn5mV1iWFKw n7K1bbQ6BxwgtyVtaovfMhQG/YeZq/zscdxrHieedXbKG+SZaN48BJrowGxOfNlz4FVl NgmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ELKPhSxacmtWooUHRjTQCUPfY85bfbS647WpCbFJgWQ=; b=IZ3oIocJGRIEBWyJu2sbK4SvpYaX7y9JaGrOP69CgaxACPOzfGhC/2R3p17498BkR8 P4NJw6KQHGxL2baJXEWIWPB/t3JVVagOJaZgtHzNppCWPVCMDYHZ6XsfHmASUPfl/aGj r0Pp10ZNEzkyWGu+yOrcpmMmWhZAKPDf1YhBHOk3I9yaMVpbmR4Iri7XqmyJ/mnCtJh7 BNO9xpHjMsk72p48ugqUu/zHmfLWVrWsFZSBkBJGSkneMVQbrn231Kw5IC7v6PJZNgpb KgRTMPz1xW73QHMp7a/BYOpv6jrNiElNVUCxNjbHL7lFSVlnP+pE0TyhMRHrsovXe3FS 0JEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md20si8939454ejb.203.2020.06.15.01.13.38; Mon, 15 Jun 2020 01:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728526AbgFOIJK (ORCPT + 99 others); Mon, 15 Jun 2020 04:09:10 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:36890 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728162AbgFOIJK (ORCPT ); Mon, 15 Jun 2020 04:09:10 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 7E5ED7E1BDB3F9E58F43; Mon, 15 Jun 2020 16:09:03 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Mon, 15 Jun 2020 16:08:56 +0800 From: Jing Xiangfeng To: , , , CC: , , , , Subject: [PATCH] scsi: iscsi: Do not put host in iscsi_set_flashnode_param() Date: Mon, 15 Jun 2020 16:12:26 +0800 Message-ID: <20200615081226.183068-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If scsi_host_lookup() failes we will jump to put_host, which may cause panic. Jump to exit_set_fnode to fix it. Signed-off-by: Jing Xiangfeng --- drivers/scsi/scsi_transport_iscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index f4cc08e..c5e99f9 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -3291,7 +3291,7 @@ static int iscsi_set_flashnode_param(struct iscsi_transport *transport, pr_err("%s could not find host no %u\n", __func__, ev->u.set_flashnode.host_no); err = -ENODEV; - goto put_host; + goto exit_set_fnode; } idx = ev->u.set_flashnode.flashnode_idx; -- 1.8.3.1