]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] zfcp: return early from slave_destroy if slave_alloc returned early
authorSteffen Maier <maier@linux.vnet.ibm.com>
Fri, 18 Nov 2011 19:00:40 +0000 (20:00 +0100)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 14 Dec 2011 11:40:43 +0000 (15:40 +0400)
commita27acb84f08c83c5897257d62b39b2d2c90950f7
treebbaf28b480018835fb61db1dd13ce8bd4d4e8b97
parentaff69615a00034e155908aeb244f841b0c157022
[SCSI] zfcp: return early from slave_destroy if slave_alloc returned early

zfcp_scsi_slave_destroy erroneously always tried to finish its task
even if the corresponding previous zfcp_scsi_slave_alloc returned
early. This can lead to kernel page faults on accessing uninitialized
fields of struct zfcp_scsi_dev in zfcp_erp_lun_shutdown_wait. Take the
port field of the struct to determine if slave_alloc returned early.

This zfcp bug is exposed by 8ff6627 (in turn fixing a5250f8 to be
compatible with 8310a91) which can call slave_destroy for a
corresponding previous slave_alloc that did not finish.

This patch is based on James Bottomley's fix suggestion in
http://www.spinics.net/lists/linux-scsi/msg55449.html.

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Cc: <stable@kernel.org> #2.6.38+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/s390/scsi/zfcp_scsi.c