target: Fix target_sense_desc_format NULL pointer dereference
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 16 Sep 2015 06:07:45 +0000 (23:07 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 25 Sep 2015 06:17:23 +0000 (23:17 -0700)
commitf3bb467ff64b2598d023b3a07592748fa7768b6a
tree2c961b5c54a31d3bfc267f7308b2c32c26fd786e
parenteeeb9522231118138be418ff527dc8c9050f4707
target: Fix target_sense_desc_format NULL pointer dereference

This patch allows target_sense_desc_format() to be called without a
valid se_device pointer, which can occur during an early exception
ahead of transport_lookup_cmd_lun() setting up se_cmd->se_device.

This addresses a v4.3-rc1 specific NULL pointer dereference
regression introduced by commit 4e4937e8.

Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_hba.c