[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250421081604.655282-3-bbelyavtsev@usergate.com>
Date: Mon, 21 Apr 2025 15:16:03 +0700
From: Boris Belyavtsev <bbelyavtsev@...rgate.com>
To: <hare@...e.com>
CC: <linux-scsi@...r.kernel.org>,<linux-kernel@...r.kernel.org>,<lvc-project@...uxtesting.org>,Boris Belyavtsev <bbelyavtsev@...rgate.com>
Subject: [PATCH 6.1 v2 2/3] scsi: aic79xx: check for non-NULL scb in
ahd_handle_pkt_busfree
If hardware returns invalid scbid scb could be NULL.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Boris Belyavtsev <bbelyavtsev@...rgate.com>
---
drivers/scsi/aic7xxx/aic79xx_core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
index a4d5376123d3..3595a1e35a69 100644
--- a/drivers/scsi/aic7xxx/aic79xx_core.c
+++ b/drivers/scsi/aic7xxx/aic79xx_core.c
@@ -2998,6 +2998,10 @@ ahd_handle_pkt_busfree(struct ahd_softc *ahd, u_int busfreetime)
ahd_print_path(ahd, scb);
printk("Unexpected PKT busfree condition\n");
ahd_dump_card_state(ahd);
+ if (scb == NULL) {
+ printk("scb pointer is NULL\n");
+ return (1);
+ }
ahd_abort_scbs(ahd, SCB_GET_TARGET(ahd, scb), 'A',
SCB_GET_LUN(scb), SCB_GET_TAG(scb),
ROLE_INITIATOR, CAM_UNEXP_BUSFREE);
--
2.43.0
Powered by blists - more mailing lists