diff options
author | Sagi Grimberg <sagig@mellanox.com> | 2015-05-20 12:38:58 +0300 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-06-02 17:26:32 -0700 |
commit | 4ce30874f561faa15e87fcf0592eee14c26cb78b (patch) | |
tree | b2663cad1c58dc8cc3cbddd470a1cd2d6833b335 /drivers/scsi/scsi_transport_iscsi.c | |
parent | e03c2da6574223081b786960e39c1e5ecf5d492d (diff) | |
download | linux-4ce30874f561faa15e87fcf0592eee14c26cb78b.tar.bz2 |
iscsi: Fix iscsi endpoints leak
When creating a new endpoint, we look for a free id
for the new endpoint. We baisically loop on possible ids
and use the first id that class_find_device() returns NULL.
However, we are missing a reference put when class_find_device()
does find an existing device for a given id.
Reported-by: Alex Lyakas <alex@zadarastorage.com>
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 67d43e35693d..55647aae065c 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -204,6 +204,8 @@ iscsi_create_endpoint(int dd_size) iscsi_match_epid); if (!dev) break; + else + put_device(dev); } if (id == ISCSI_MAX_EPID) { printk(KERN_ERR "Too many connections. Max supported %u\n", |