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)
committerJiri Slaby <jslaby@suse.cz>
Wed, 3 Jun 2015 09:33:09 +0000 (11:33 +0200)
commitc9b036ca04b6b269d23fecb100b258b7bc6d4fd2
tree6f2be0c0ddb1420c53e3426ccfae14d8d211f8fc
parent7e99e685f1e4eeddc6de8cd020eddb8deb32fcf1
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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/target/target_core_pscsi.c
drivers/target/target_core_pscsi.h