scsi-3w-9xxx: NULL check in twa_scsiop_execute_scsi()
PATCH 1/1 scsi-3w-9xxx: NULL check in twa_scsiop_execute_scsi()
From: Alexandr Sapozhnikov <[email protected]>
After having been compared to NULL value at 3w-9xxx.c:1829, pointer 'srb' is passed as 1st parameter in call to function 'scsi_sg_count' at 3w-9xxx.c:1844, where it is dereferenced.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Alexandr Sapozhnikov <[email protected]>
--- drivers/scsi/3w-9xxx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/3w-9xxx.c +1 -1
@@ -1841,7 +1841,7 @@ static int twa_scsiop_execute_scsi(TW_Device_Extension *tw_dev, int request_id,if (!sglistarg) {/* Map sglist from scsi layer to cmd packet */ -if (scsi_sg_count (srb)) { +if (srb &&scsi_sg_count (srb)) {if (!twa_command_mapped (srb)) {if (srb->sc_data_direction ==DMA_TO_DEVICE || srb->sc_data_direction ==DMA_BIDIRECTIONAL )
Signature · 1 line
2.5.3