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:01:01 +0000 (15:01 +0100)
commit3bb09afbcef61767194ef3792755e38265915cd9
tree5ecc60adfee1f692b1db15e584643fbfd1e29abc
parent2078161617e32d457414cd9accabe33909142b90
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