zfcp: test kmalloc failure in scsi_get_vpd_page()
PATCH 11/18 zfcp: test kmalloc failure in scsi_get_vpd_page()
From: Roel Kluin <[email protected]>
kmalloc() may fail, so test whether it succeeded.
Signed-off-by Roel Kluin <[email protected]>
Cc James Bottomley <[email protected]>
Cc Wei Yongjun <[email protected]>
Cc Mike Christie <[email protected]>
Cc Boaz Harrosh <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/scsi/scsi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/scsi.c renamed from drivers/scsi/scsi.c~zfcp-test-kmalloc-failure-in-scsi_get_vpd_page +2 -0
@@ -1066,6 +1066,8 @@ unsigned char *scsi_get_vpd_page(structkfree (buf); buf =kmalloc (len,GFP_KERNEL ); +if (!buf) +return NULL ; result =scsi_vpd_inquiry (sdev, buf, page, len);if (result) goto fail;
_