From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 0E546248881; Wed, 25 Feb 2026 01:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771983375; cv=none; b=AhjdUunuafXGbBEF+iSmHf3kZ8kVjvz+PwHTElyfhjOwVXOG7S8OUOBRv7VgupWSKneFnHw5CYK+CtRAnBxGMSEZ7C9ZsusPEK9DjGxD+leSi9Ziesttqx45xHEjShK3Zs1RF1tk/GFRg8CZ+O3BXSqkNeHdb36scREDJ6ECCcg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771983375; c=relaxed/simple; bh=pb5jPxl7Sp5kUoQmtgfM2gsYl8XQhE/ZqbbaWO88+dc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bIbGMFs+kWa5S/Bd4K/NsJo3HAll4wo24npMiNpSG+5tR4phZuHbZicnK9FmiS27AvCwStoFNxcnWRkypeGE9e80J0tsXtCqTiO7rl703M5cdeibk0k6CI3d3VYq6UtvqhWtl2kKhAAHVsYkUXdSpep0lGS6lttU5GjX9eg2i1c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EqcqV6hw; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EqcqV6hw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA10EC19423; Wed, 25 Feb 2026 01:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1771983374; bh=pb5jPxl7Sp5kUoQmtgfM2gsYl8XQhE/ZqbbaWO88+dc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EqcqV6hw6xY8B1bpY506z4KeXMu8sv2R47RgDO0K4kPM06lJ6ZulkJOKso+QdjIrg MS2mSZdi0ips+PWkbeS6H7jPrG3pe3zfiwquwIgoHxm5JaGsqrKFaRS4ozFzkylRNl AbLQNU6XtgPRwSnk0T0tUZOn0b/EAhkvdjM34LbU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Colin Ian King , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 6.19 500/781] scsi: csiostor: Fix dereference of null pointer rn Date: Tue, 24 Feb 2026 17:20:09 -0800 Message-ID: <20260225012412.068317346@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260225012359.695468795@linuxfoundation.org> References: <20260225012359.695468795@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Colin Ian King [ Upstream commit 1982257570b84dc33753d536dd969fd357a014e9 ] The error exit path when rn is NULL ends up deferencing the null pointer rn via the use of the macro CSIO_INC_STATS. Fix this by adding a new error return path label after the use of the macro to avoid the deference. Fixes: a3667aaed569 ("[SCSI] csiostor: Chelsio FCoE offload driver") Signed-off-by: Colin Ian King Link: https://patch.msgid.link/20260129155332.196338-1-colin.i.king@gmail.com Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/csiostor/csio_scsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/csiostor/csio_scsi.c b/drivers/scsi/csiostor/csio_scsi.c index 34bde6650fae0..356a7c577ec3e 100644 --- a/drivers/scsi/csiostor/csio_scsi.c +++ b/drivers/scsi/csiostor/csio_scsi.c @@ -2074,7 +2074,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd) struct csio_scsi_level_data sld; if (!rn) - goto fail; + goto fail_ret; csio_dbg(hw, "Request to reset LUN:%llu (ssni:0x%x tgtid:%d)\n", cmnd->device->lun, rn->flowid, rn->scsi_id); @@ -2220,6 +2220,7 @@ csio_eh_lun_reset_handler(struct scsi_cmnd *cmnd) csio_put_scsi_ioreq_lock(hw, scsim, ioreq); fail: CSIO_INC_STATS(rn, n_lun_rst_fail); +fail_ret: return FAILED; } -- 2.51.0