Skip to contentSkip to conversation

scsi: hpsa: fix the device_id in hpsa_update_device_info()

PATCH Applied Dan Carpenter 3 participants 3 messages Aug 17, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: hpsa: fix the device_id in hpsa_update_device_info()

The parentheses are in the wrong place so we specify the length as "sizeof(this_device->device_id) < 0" which is zero.

Fixes 988b87edd231 ("scsi: hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page")
drivers/scsi/hpsa.c +1 -1
index 2773dd7a2087..a22295ee3b70 100644
@@ -3827,7 +3827,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 	memset(this_device->device_id, 0,
 		sizeof(this_device->device_id));
 	if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
-		sizeof(this_device->device_id) < 0))
+		sizeof(this_device->device_id)) < 0)
 		dev_err(&h->pdev->dev,
 			"hpsa%d: %s: can't get device id for host %d:C0:T%d:L%d\t%s\t%.16s\n",
 			h->ctlr, __func__,
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Dan Carpenter

The parentheses are in the wrong place so we specify the length as "sizeof(this_device->device_id) < 0" which is zero.

Fixes 988b87edd231 ("scsi: hpsa: Ignore errors for unsupported LV_DEVICE_ID VPD page")
drivers/scsi/hpsa.c +0 -0
index 2773dd7a2087..a22295ee3b70 100644

drivers/scsi/hpsa.c static int hpsa_update_device_info(struct ctlr_info *h, · line 3833

Quoted 8 lines
drivers/scsi/hpsa.c +1 -1
@@ -3827,7 +3827,7 @@ static int hpsa_update_device_info(struct ctlr_info *h,
 	memset(this_device->device_id, 0,
 		sizeof(this_device->device_id));
 	if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8,
-		sizeof(this_device->device_id) < 0))
+		sizeof(this_device->device_id)) < 0)
 		dev_err(&h->pdev->dev,
 			"hpsa%d: %s: can't get device id for host %d:C0:T%d:L%d\t%s\t%.16s\n",
 			h->ctlr, __func__,

Cheers,

Hannes

Signature · 5 lines
Dr. Hannes Reinecke		   Teamlead Storage & Networking
[email protected]			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
#2 lore raw
In reply to Dan Carpenter

Dan,

Quoted 2 lines

The parentheses are in the wrong place so we specify the length as "sizeof(this_device->device_id) < 0" which is zero.

Applied to 4.14/scsi-queue. Thank you!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering