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)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Aug 2015 23:32:13 +0000 (00:32 +0100)
commit48793a2e5abc126a6446d8497c2117489622e9db
tree035b69f550f8bc2d12e6b1cf6fbf04d0268da8dd
parent7a1cc643ca060a2f6506f7c94c4c46f865a7726f
target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST

commit 5a7125c64def3b21f8147eca8b54949a60963942 upstream.

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>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/target/target_core_pscsi.c
drivers/target/target_core_pscsi.h