From nobody Fri Dec 19 07:50:27 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 58400C6FA82 for ; Tue, 13 Sep 2022 14:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232937AbiIMOOT (ORCPT ); Tue, 13 Sep 2022 10:14:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232994AbiIMONl (ORCPT ); Tue, 13 Sep 2022 10:13:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70FD06051A; Tue, 13 Sep 2022 07:10:30 -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 04A45614A1; Tue, 13 Sep 2022 14:10:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F6EEC43140; Tue, 13 Sep 2022 14:10:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078223; bh=YT6Y9sh7nLwG2U9f/xoa4qYNPvQIbZLnaR3oXvuXZG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QAGZG2MKCFl5A2ZTg0MbScn4krhUy9+Ig2XuZRQ98TQWbvs9gDUiBQV9BhizFyI/d OPhpI5lF7Z4aMOfO3G1ZTFYuJ6dMUHDxQeRwtHeZeB5XxYZSF57JocSPs/Nxc8lqu/ xH29CmfnD4RDuKdqI5Dlf1Bvn//MZFqe6212i4Cc= 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.19 059/192] scsi: lpfc: Add missing destroy_workqueue() in error path Date: Tue, 13 Sep 2022 16:02:45 +0200 Message-Id: <20220913140412.886874323@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140410.043243217@linuxfoundation.org> References: <20220913140410.043243217@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 @@ -8061,7 +8061,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 @@ -8489,6 +8489,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; }