Commit 36631157 authored by Colin Ian King's avatar Colin Ian King Committed by Martin K. Petersen

scsi: hpsa: fix an uninitialized read and dereference of pointer dev

Currently the check for a lockup_detected failure exits via the label
return_reset_status that reads and dereferences an uninitialized pointer
dev.  Fix this by ensuring dev is inintialized to null.

Addresses-Coverity: ("Uninitialized pointer read")
Fixes: 14991a5bade5 ("scsi: hpsa: correct device resets")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarDon Brace <don.brace@microsemi.com>
Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 8a914f32
...@@ -5947,7 +5947,7 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd) ...@@ -5947,7 +5947,7 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
int rc = SUCCESS; int rc = SUCCESS;
int i; int i;
struct ctlr_info *h; struct ctlr_info *h;
struct hpsa_scsi_dev_t *dev; struct hpsa_scsi_dev_t *dev = NULL;
u8 reset_type; u8 reset_type;
char msg[48]; char msg[48];
unsigned long flags; unsigned long flags;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment