From nobody Mon Sep 8 08:43:35 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BABFC6FA82 for ; Tue, 13 Sep 2022 15:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236523AbiIMPap (ORCPT ); Tue, 13 Sep 2022 11:30:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236515AbiIMP26 (ORCPT ); Tue, 13 Sep 2022 11:28:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3926915A32; Tue, 13 Sep 2022 07:39:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B631614CC; Tue, 13 Sep 2022 14:29:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 18A7AC433C1; Tue, 13 Sep 2022 14:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079354; bh=PDblyY3uJAnHL6jUhz0UAnUwHzXsWXAJQ/kKMtgqiJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W7iNekNeFN0gHyad4Q1tDZjalqpnI928JRiu06rnNRXwtD0K3XwYe/Z5kUzvcxJeN N7OCOByUp68fIZDG+P2rnNTqJR7b0mHsDb2b9ZHrRkg4UswiGpxmkqgUPsKv2TXe3r 9sJwbjYUAHYW9S13vFvntigRlzUNFqgdsnc3RGjY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Smart , Yang Yingliang , "Martin K. Petersen" Subject: [PATCH 5.4 084/108] scsi: lpfc: Add missing destroy_workqueue() in error path Date: Tue, 13 Sep 2022 16:06:55 +0200 Message-Id: <20220913140357.234308336@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140353.549108748@linuxfoundation.org> References: <20220913140353.549108748@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Yang Yingliang commit da6d507f5ff328f346b3c50e19e19993027b8ffd upstream. Add the missing destroy_workqueue() before return from lpfc_sli4_driver_resource_setup() in the error path. Link: https://lore.kernel.org/r/20220823044237.285643-1-yangyingliang@huawe= i.com Fixes: 3cee98db2610 ("scsi: lpfc: Fix crash on driver unload in wq free") Reviewed-by: James Smart Signed-off-by: Yang Yingliang Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -6537,7 +6537,7 @@ lpfc_sli4_driver_resource_setup(struct l /* Allocate device driver memory */ rc =3D lpfc_mem_alloc(phba, SGL_ALIGN_SZ); if (rc) - return -ENOMEM; + goto out_destroy_workqueue; =20 /* IF Type 2 ports get initialized now. */ if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >=3D @@ -6911,6 +6911,9 @@ out_free_bsmbx: lpfc_destroy_bootstrap_mbox(phba); out_free_mem: lpfc_mem_free(phba); +out_destroy_workqueue: + destroy_workqueue(phba->wq); + phba->wq =3D NULL; return rc; }