target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST
authorAndy Grover <agrover@redhat.com>
Fri, 22 May 2015 21:07:44 +0000 (14:07 -0700)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 10 Jun 2015 17:42:15 +0000 (13:42 -0400)
commite0bc573f09efd4c681e94d3260722646934b9051
treeccfc597462d2d7ed35e6025b675d91eec6591b1f
parent4d0b92162bd496128f027934010e27012fe0d5d0
target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST

[ Upstream commit 5a7125c64def3b21f8147eca8b54949a60963942 ]

See https://bugzilla.redhat.com/show_bug.cgi?id=1025672

We need to put() the reference to the scsi host that we got in
pscsi_configure_device(). In VIRTUAL_HOST mode it is associated with
the dev_virt, not the hba_virt.

Signed-off-by: Andy Grover <agrover@redhat.com>
Cc: stable@vger.kernel.org # 2.6.38+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/target/target_core_pscsi.c
drivers/target/target_core_pscsi.h