Commit 149e08fb 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>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 67015751
......@@ -1057,6 +1057,8 @@ unsigned char *scsi_get_vpd_page(struct scsi_device *sdev, u8 page)
kfree(buf);
buf = kmalloc(len, GFP_KERNEL);
if (!buf)
return NULL;
result = scsi_vpd_inquiry(sdev, buf, page, len);
if (result)
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