Commit e1779b4f authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: scsi_transport_sas: Check kzalloc() return value

Check whether memory allocation succeeded before dereferencing
the pointer to the allocated memory.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent e656f0d0
......@@ -421,6 +421,9 @@ sas_tlr_supported(struct scsi_device *sdev)
char *buffer = kzalloc(vpd_len, GFP_KERNEL);
int ret = 0;
if (!buffer)
goto out;
if (scsi_get_vpd_page(sdev, 0x90, buffer, vpd_len))
goto out;
......
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