scsi: hpsa: fix the device_id in hpsa_update_device_info()
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")
Signed-off-by Dan Carpenter <[email protected]>
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__,
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")Signed-off-by Dan Carpenter <[email protected]>drivers/scsi/hpsa.c +0
-0
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__,
Reviewed-by Hannes Reinecke <[email protected]>
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)
Martin K. Petersen
AppliedDan,
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