فهرست منبع

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>
Sagi Grimberg 10 سال پیش
والد
کامیت
4ce30874f5
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      drivers/scsi/scsi_transport_iscsi.c

+ 2 - 0
drivers/scsi/scsi_transport_iscsi.c

@@ -204,6 +204,8 @@ iscsi_create_endpoint(int dd_size)
 					iscsi_match_epid);
 					iscsi_match_epid);
 		if (!dev)
 		if (!dev)
 			break;
 			break;
+		else
+			put_device(dev);
 	}
 	}
 	if (id == ISCSI_MAX_EPID) {
 	if (id == ISCSI_MAX_EPID) {
 		printk(KERN_ERR "Too many connections. Max supported %u\n",
 		printk(KERN_ERR "Too many connections. Max supported %u\n",