scsi: scsi_transport_sas: Check kzalloc() return value
authorBart Van Assche <bart.vanassche@wdc.com>
Fri, 25 Aug 2017 20:46:40 +0000 (13:46 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 21:08:08 +0000 (17:08 -0400)
commite1779b4ff5412fcb7f943f6b49cac5e70fc724e2
treec3859142363d4cf5dae07aa0085929630a689b82
parente656f0d07aeb68b120a0033dbd1ac2d48da65a41
scsi: scsi_transport_sas: Check kzalloc() return value

Check whether memory allocation succeeded before dereferencing
the pointer to the allocated memory.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_transport_sas.c