target: prevent NULL pointer dereference in target_report_luns
authorJörn Engel <joern@logfs.org>
Wed, 15 Feb 2012 21:52:11 +0000 (16:52 -0500)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sat, 25 Feb 2012 22:37:50 +0000 (14:37 -0800)
commit47f1b8803e1e358ebbf4f82bfdb98971c912a2c3
treec5d85478fb2c7245a819b707adc7fca2b926b4c3
parent382436f8804fe1cb20b9a2a811a10eb2d8554721
target: prevent NULL pointer dereference in target_report_luns

transport_kmap_data_sg can return NULL.  I never saw this trigger, but
returning -ENOMEM seems better than a crash.  Also removes a pointless
case while at it.

Signed-off-by: Joern Engel <joern@logfs.org>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_device.c