[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN6PR11MB27672A7C88FE3EB111B4FF64E1010@SN6PR11MB2767.namprd11.prod.outlook.com>
Date: Thu, 23 May 2019 15:25:48 +0000
From: <Don.Brace@...rochip.com>
To: <colin.king@...onical.com>, <don.brace@...rosemi.com>,
<jejb@...ux.ibm.com>, <martin.petersen@...cle.com>,
<esc.storagedev@...rosemi.com>, <linux-scsi@...r.kernel.org>
CC: <kernel-janitors@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH][next] scsi: hpsa: fix an uninitialized read and
dereference of pointer dev
----Original Message-----
From: linux-scsi-owner@...r.kernel.org [mailto:linux-scsi-owner@...r.kernel.org] On Behalf Of Colin King
Sent: Wednesday, May 22, 2019 3:39 AM
To: Don Brace <don.brace@...rosemi.com>; James E . J . Bottomley <jejb@...ux.ibm.com>; Martin K . Petersen <martin.petersen@...cle.com>; esc.storagedev@...rosemi.com; linux-scsi@...r.kernel.org
Cc: kernel-janitors@...r.kernel.org; linux-kernel@...r.kernel.org
Subject: [PATCH][next] scsi: hpsa: fix an uninitialized read and dereference of pointer dev
From: Colin Ian King <colin.king@...onical.com>
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: Colin Ian King <colin.king@...onical.com>
I sent up a similar patch on 5/16, but this is just as good.
Acked-by: Don Brace <don.brace@...rosemi.com>
Thanks for your patch.
---
drivers/scsi/hpsa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index c560a4532733..ac8338b0571b 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -5947,7 +5947,7 @@ static int hpsa_eh_device_reset_handler(struct scsi_cmnd *scsicmd)
int rc = SUCCESS;
int i;
struct ctlr_info *h;
- struct hpsa_scsi_dev_t *dev;
+ struct hpsa_scsi_dev_t *dev = NULL;
u8 reset_type;
char msg[48];
unsigned long flags;
--
2.20.1
Powered by blists - more mailing lists