Commit 6b519d4b authored by Roel Kluin's avatar Roel Kluin Committed by james toy

kmalloc() may fail, so test whether it succeeded.

Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Wei Yongjun <yjwei@cn.fujitsu.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ff5c82d0
...@@ -1066,6 +1066,8 @@ unsigned char *scsi_get_vpd_page(struct scsi_device *sdev, u8 page) ...@@ -1066,6 +1066,8 @@ unsigned char *scsi_get_vpd_page(struct scsi_device *sdev, u8 page)
kfree(buf); kfree(buf);
buf = kmalloc(len, GFP_KERNEL); buf = kmalloc(len, GFP_KERNEL);
if (!buf)
return NULL;
result = scsi_vpd_inquiry(sdev, buf, page, len); result = scsi_vpd_inquiry(sdev, buf, page, len);
if (result) if (result)
goto fail; goto fail;
......
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