提交 a84d794d 编写于 作者: S Stephen M. Cameron 提交者: Christoph Hellwig

hpsa: return -ENOMEM not -1 on kzalloc failure in hpsa_get_device_id

Signed-off-by: NStephen M. Cameron <scameron@beardog.cce.hp.com>
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NMike Miller <michael.miller@canonical.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 24a4b078
......@@ -2430,7 +2430,7 @@ static int hpsa_get_device_id(struct ctlr_info *h, unsigned char *scsi3addr,
buflen = 16;
buf = kzalloc(64, GFP_KERNEL);
if (!buf)
return -1;
return -ENOMEM;
rc = hpsa_scsi_do_inquiry(h, scsi3addr, VPD_PAGE | 0x83, buf, 64);
if (rc == 0)
memcpy(device_id, &buf[8], buflen);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册