From nobody Sun Sep 14 22:43:21 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 B7066C54EE9 for ; Tue, 13 Sep 2022 14:33:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233829AbiIMOdV (ORCPT ); Tue, 13 Sep 2022 10:33:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234007AbiIMOck (ORCPT ); Tue, 13 Sep 2022 10:32:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FB4B3A486; Tue, 13 Sep 2022 07:19:18 -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 ams.source.kernel.org (Postfix) with ESMTPS id 45D9DB80F3B; Tue, 13 Sep 2022 14:19:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ADD6C433D7; Tue, 13 Sep 2022 14:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663078748; bh=BrsrdON7KovxOojInyEqPaghbcoHurwYXeZgZyEoYmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hq+HBe07zzGqDy1D655Jln049uNtjttRvdJrisX6Ww0GNCxfjhgBa3vnImvt50Zvn oDeVGeUfYA/aCL8sQbe8OClYPkiHKT05UmHm4FftbTJTSjjqTsCwPWj6TrATjHr6Db OGZ6JpL1CTafndGQ9wQ5VUdMvO3qQfXVqKzGGZmA= 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.15 042/121] scsi: lpfc: Add missing destroy_workqueue() in error path Date: Tue, 13 Sep 2022 16:03:53 +0200 Message-Id: <20220913140359.174786600@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140357.323297659@linuxfoundation.org> References: <20220913140357.323297659@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 @@ -7893,7 +7893,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 @@ -8309,6 +8309,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; }