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 06EC044AB9F; Tue, 21 Jul 2026 22:52:48 +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=1784674370; cv=none; b=GKjH0Z+UPhlpbEJi1hwi26kaDSzxhdi6DLH0zVWcQDisKUdKonbJjih2r6Q7tXdYiwFL/lBT+R5BwnjAo3ApEoI4035THE1fuld67lthEFIIw0TnwpngHUvMRv6q+UKFwN/2bga6VqVLcSanUoy1SSRJKAnbDbQo5XNXTXkpb8k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784674370; c=relaxed/simple; bh=XHpR1D6wA5YhDm0B4a6PM/6iWju2vEaaezPhrEcx8A8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GJntRQ+g7ZWDqxNMRdB2upQJiaiOkf0jI/z1SvQUjNJ3uRmIrVptZr1XnPvtMpDckd79i8kRFJwyuzmcU6GmeQO/9RFHvHbFJdWdovPRfaZtdaqtUgoD+eR4aEgJaEVYWu5y3iRsys1VEpHXz5ooC8lv6bMr4cFVt86OJDyX90w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=TwSTT5p7; 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="TwSTT5p7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23D4E1F000E9; Tue, 21 Jul 2026 22:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784674368; bh=CYILRQ0+uwJ2tAVKUWiF0WvaIDse856aAId/kxB+NaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TwSTT5p7WQZea9GLj/D1b5NYM2ROrZETNoWx9qSQdlWRfbcKsLzz81APUy0xxov2E 6weHxvRQD2/yvKfMXasPIFyy7FHmcGiBjAMbGUU1HwEqR9QgWCwrZYXBxwrsFmHtr2 yEamUjPuxP3Y0v+MJuGWqUZJ26Ozk13pEDEPBg7k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Haoxiang Li , Don Brace , "Martin K. Petersen" Subject: [PATCH 5.10 515/699] scsi: hpsa: Fix DMA mapping leak on IOACCEL2 reset path Date: Tue, 21 Jul 2026 17:24:34 +0200 Message-ID: <20260721152407.312895928@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152355.667394603@linuxfoundation.org> References: <20260721152355.667394603@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 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Haoxiang Li commit e166bafc483e927150cb9b5f286c9191ea0df84e upstream. If phys_disk->in_reset is set, the function returns directly without undoing the resources acquired for the command. Add the missing error cleanup by unmapping the IOACCEL2 SG chain block when needed, unmapping the SCSI command, and dropping the outstanding IOACCEL command count before returning. Fixes: c5dfd106414f ("scsi: hpsa: correct device resets") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li Acked-by: Don Brace Link: https://patch.msgid.link/20260622160028.1240496-1-haoxiang_li2024@163.com Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/hpsa.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -5035,6 +5035,10 @@ static int hpsa_scsi_ioaccel2_queue_comm if (phys_disk->in_reset) { cmd->result = DID_RESET << 16; + atomic_dec(&phys_disk->ioaccel_cmds_out); + scsi_dma_unmap(cmd); + if (use_sg > h->ioaccel_maxsg) + hpsa_unmap_ioaccel2_sg_chain_block(h, cp); return -1; }