From patchwork Tue Sep 1 15:08:54 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: 310300 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 584AFC433E7 for ; Tue, 1 Sep 2020 16:39:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19F7920767 for ; Tue, 1 Sep 2020 16:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598978340; bh=EypvJmI80cOBcFHKPawHti9nNSIPxfesQkbtnpmuuts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e8kAH6QqUYEQMs1DYb3ZSczVUynoGbYNM5ioLkopqlo8q5C7vrBO3JsjIeGTWaAeR x3ZyG190QsyHVHmJUk+dRvs6sMvqfhlyMkabp/Bc9OqNrbWOxlIBlIrClRSwN3vkmv GEiyWk5p01Gme/zy1e/3z5Mui0ek9cZ2e4kCRbQ0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730458AbgIAQig (ORCPT ); Tue, 1 Sep 2020 12:38:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:57108 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730410AbgIAP2r (ORCPT ); Tue, 1 Sep 2020 11:28:47 -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 B1DF02078B; Tue, 1 Sep 2020 15:28:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974127; bh=EypvJmI80cOBcFHKPawHti9nNSIPxfesQkbtnpmuuts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X2M84IN/+f47DtPEScsB3qNiocGtmaW6FqfBgfHuzbDMYC3bAA80WfcBpqzLQIEsM jh3xPB2nYLJjmoWefGMPkEcSchxpBYj1AmMlnxFv/rMo45Xc1QMDK8YpK+l1wr/5q4 K74S70tutCTl1pu3n4Uzow8LJKNNGpvTLfx+AKDY= 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.4 054/214] scsi: iscsi: Do not put host in iscsi_set_flashnode_param() Date: Tue, 1 Sep 2020 17:08:54 +0200 Message-Id: <20200901150955.569709263@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150952.963606936@linuxfoundation.org> References: <20200901150952.963606936@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 a5c78b38d3022..dbad926e8f87f 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -3174,7 +3174,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;