Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 394BD46AA89; Tue, 21 Jul 2026 17:27:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784654879; cv=none; b=M94jHsMoigh6bCrn4ufQgpuakWj4MD/Bie7oe2tK9vslXIgUSsfEugL98Fx6oUvIcnd0i72pbiAvK1nBY4wWh7mgehvXvfjPGWhRvyxImALDcR9EhcQiE0w2GbMy5WGc/Y7tsGaypb33c4sKyopJ+3HwOgUphpJEwPiasnuSpIw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784654879; c=relaxed/simple; bh=bkEgIq62/VQVIhXnSEGOJj3eXFfrjkQSukwpyr67k7k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Nno6aSH/0b/f7eC3hP0zvHX+cmo6srNA3kDy7X80hK2Ek7FPInJvvWV8h11mtj90rnbtJ3F2mWdJQb14pmgQq5lvwszc7B9Whm09uDfLfky7lo+ToUCIGLDlKCZdErDMzXPXtv63rrBmoWIk7RwdLs/MQXhN+LUJJmqDJPJQF6U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SJSJ9fiy; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="SJSJ9fiy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 634F01F000E9; Tue, 21 Jul 2026 17:27:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784654875; bh=IyA1EUx/OQ8sIBCNsDJuZZ+5fpCsui9AgwVBAkISoGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=SJSJ9fiynIjr3x5HOBniafh+utsRbHgOZjRqRnwMbckAhnEKPP6jHcR4MO39lJeis PucIyH3dayf3CaJpgCo9LXTwo/l7YIwnSjgTpBK/jqgudkA17KvHXIRAAgWWoWd6IE BqO6GQ2tqgEXyxH5pBKb3DDYDFi2QzPV6dnxpPL4= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abdun Nihaal , Justin Tee , "Martin K. Petersen" Subject: [PATCH 7.1 1871/2077] scsi: lpfc: Fix memory leak in lpfc_sli4_driver_resource_setup() Date: Tue, 21 Jul 2026 17:25:44 +0200 Message-ID: <20260721152636.863846668@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152552.646164743@linuxfoundation.org> References: <20260721152552.646164743@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Abdun Nihaal commit 1bd28625e25be549ee7c47532e7c3ef91c682410 upstream. The memory allocated for mboxq using mempool_alloc() is not freed in some of the early exit error paths. Fix that by moving the mempool_free() call to an earlier point after last use. Fixes: d79c9e9d4b3d ("scsi: lpfc: Support dynamic unbounded SGL lists on G7 hardware.") Cc: stable@vger.kernel.org Signed-off-by: Abdun Nihaal Reviewed-by: Justin Tee Link: https://patch.msgid.link/20260707065304.949135-1-nihaal@cse.iitm.ac.in Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/lpfc/lpfc_init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -8189,6 +8189,7 @@ lpfc_sli4_driver_resource_setup(struct l mempool_free(mboxq, phba->mbox_mem_pool); goto out_free_bsmbx; } + mempool_free(mboxq, phba->mbox_mem_pool); /* * 1 for cmd, 1 for rsp, NVME adds an extra one @@ -8311,8 +8312,6 @@ lpfc_sli4_driver_resource_setup(struct l goto out_free_sg_dma_buf; } - mempool_free(mboxq, phba->mbox_mem_pool); - /* Verify OAS is supported */ lpfc_sli4_oas_verify(phba);