From mboxrd@z Thu Jan 1 00:00:00 1970 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 CF4D13B8412; Tue, 21 Jul 2026 21:43:44 +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=1784670225; cv=none; b=ZnHly9gNt4nyqzR1Kg5yACZr2PWyna7YayCrlZIOGw+wrtrDPPce4OIvmDIeLq5VqzTHxwdXpcghtVxrt7oE7Yxj2r/59zdlx4sqBIFOxqBStXGOrxmllTFKnpp+Y8hlzkjU+619EZZx67pAdqfMqQTe2SuyeqCbiulSMTLGjxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784670225; c=relaxed/simple; bh=u2XlRUv2Ia6Kp6wMd5ayLlxjMrMK7RsUt56FWHQ+KD0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P9z1SH6Vzxn9oigO2dReTzeH5DC2r/C00i7P+fHpWRWQP++H66l34Q0hekc33QcPVNxtHQzpgTvKI/N3zeIcg1NeKe5LoCocUC50LRM8Ql0yPos/fGA5PYZqMdNao3gyGZxpb831RXVnC/+2wz5gHFh0O3JXfgTpVB3apdkGSNE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mDr82NO7; 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="mDr82NO7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36FE51F000E9; Tue, 21 Jul 2026 21:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784670224; bh=7TPBK9PgIZlKnUq87Y/DonmQ/H7W/OycNuXf0aL6j60=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mDr82NO7LK4l6FjVS0QldA2wR1Ce/kopUQaDtwVyBJIrarQTAkUunkMiskzxFToHv YfyteIrXWOZveqH3H3kNZvkPMC3OsP/JKnmgGG1/2cy3q1ZL13YmXKaRPnCai5JaIJ nXDikGTEELTlwzlK2sln89VtjzjptGcAL03seDzs= 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 6.1 0853/1067] scsi: lpfc: Fix memory leak in lpfc_sli4_driver_resource_setup() Date: Tue, 21 Jul 2026 17:24:14 +0200 Message-ID: <20260721152443.624580558@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152424.521567757@linuxfoundation.org> References: <20260721152424.521567757@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 6.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 @@ -8175,6 +8175,7 @@ lpfc_sli4_driver_resource_setup(struct l } } } + mempool_free(mboxq, phba->mbox_mem_pool); lpfc_nvme_mod_param_dep(phba); @@ -8333,8 +8334,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);