]> err.no Git - linux-2.6/blobdiff - drivers/scsi/scsi_transport_iscsi.c
kgdb: kgdboc console poll hooks for cpm uart
[linux-2.6] / drivers / scsi / scsi_transport_iscsi.c
index 8e34f3c085754ee244f7fc80186f9303d1230a3a..043c3921164ff781f3b20e51232ee091d2381622 100644 (file)
@@ -170,7 +170,7 @@ iscsi_create_endpoint(int dd_size)
        int err;
 
        for (id = 1; id < ISCSI_MAX_EPID; id++) {
-               dev = class_find_device(&iscsi_endpoint_class, &id,
+               dev = class_find_device(&iscsi_endpoint_class, NULL, &id,
                                        iscsi_match_epid);
                if (!dev)
                        break;
@@ -219,14 +219,21 @@ EXPORT_SYMBOL_GPL(iscsi_destroy_endpoint);
 
 struct iscsi_endpoint *iscsi_lookup_endpoint(u64 handle)
 {
+       struct iscsi_endpoint *ep;
        struct device *dev;
 
-       dev = class_find_device(&iscsi_endpoint_class, &handle,
+       dev = class_find_device(&iscsi_endpoint_class, NULL, &handle,
                                iscsi_match_epid);
        if (!dev)
                return NULL;
 
-       return iscsi_dev_to_endpoint(dev);
+       ep = iscsi_dev_to_endpoint(dev);
+       /*
+        * we can drop this now because the interface will prevent
+        * removals and lookups from racing.
+        */
+       put_device(dev);
+       return ep;
 }
 EXPORT_SYMBOL_GPL(iscsi_lookup_endpoint);
 
@@ -240,8 +247,8 @@ static int iscsi_setup_host(struct transport_container *tc, struct device *dev,
        atomic_set(&ihost->nr_scans, 0);
        mutex_init(&ihost->mutex);
 
-       snprintf(ihost->scan_workq_name, KOBJ_NAME_LEN, "iscsi_scan_%d",
-               shost->host_no);
+       snprintf(ihost->scan_workq_name, sizeof(ihost->scan_workq_name),
+                "iscsi_scan_%d", shost->host_no);
        ihost->scan_workq = create_singlethread_workqueue(
                                                ihost->scan_workq_name);
        if (!ihost->scan_workq)