From patchwork Tue Sep 1 15:08:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 264637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 072FAC433E2 for ; Tue, 1 Sep 2020 16:08:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D88D8204EC for ; Tue, 1 Sep 2020 16:08:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598976486; bh=I24xA+xdUYKV5J6GVNJn/ZBPTE2W97W1L7NFtlcKG18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=J8waRq4ftnWdfrFNXv3CHBQwDD+AM3Zi/rblek8dOvURfMaPUK6rW/oG/VAi60AkX JTxQJBc8kaHi9Jjb2EZs2/otE3VBDqHI1pGoVOTAcT2yaMxCRiLM1a5eGwX33G9TzN T9CNvWLLYq4vPlPl64GFHz/PlI7y6o6WZ0RjYLFs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731512AbgIAQIB (ORCPT ); Tue, 1 Sep 2020 12:08:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:49764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731405AbgIAPjh (ORCPT ); Tue, 1 Sep 2020 11:39:37 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F3B6E20866; Tue, 1 Sep 2020 15:39:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974776; bh=I24xA+xdUYKV5J6GVNJn/ZBPTE2W97W1L7NFtlcKG18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k+FeebT8lwfUR4/dCpyIJ7tLVj2MCvz7K85qmXk6aTl+zsXkskX/oBV9by2yjApN1 AFvvxtvFI5NhvH2Qf0Eau3rXd6QM4dklvyn82LzONKWKlvr/8urdS9CUC5hmCvpVDO tQZnQtM6WDK7hac8GwRVW1aW3XzHvWSTOLRKUItU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Christie , Jing Xiangfeng , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.8 056/255] scsi: iscsi: Do not put host in iscsi_set_flashnode_param() Date: Tue, 1 Sep 2020 17:08:32 +0200 Message-Id: <20200901151003.404069234@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jing Xiangfeng [ Upstream commit 68e12e5f61354eb42cfffbc20a693153fc39738e ] If scsi_host_lookup() fails we will jump to put_host which may cause a panic. Jump to exit_set_fnode instead. Link: https://lore.kernel.org/r/20200615081226.183068-1-jingxiangfeng@huawei.com Reviewed-by: Mike Christie Signed-off-by: Jing Xiangfeng Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 7ae5024e78243..df07ecd94793a 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;