target/pscsi: Fix NULL pointer dereference in get_device_type
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 27 Feb 2015 11:54:13 +0000 (03:54 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Mar 2015 14:07:00 +0000 (15:07 +0100)
commitd5b825cd6eca3e370760d2d7abf34d531552f31d
treec9c1d914c0e38538e6cc0ed8d039d02b0c1925e6
parentbcbd8cdef07b7f452bb795ed80d106609d634431
target/pscsi: Fix NULL pointer dereference in get_device_type

commit 215a8fe4198f607f34ecdbc9969dae783d8b5a61 upstream.

This patch fixes a NULL pointer dereference OOPs with pSCSI backends
within target_core_stat.c code.  The bug is caused by a configfs attr
read if no pscsi_dev_virt->pdv_sd has been configured.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/target_core_pscsi.c