Skip to contentSkip to conversation

cio: double put_device() in subchannel_register()

PATCH Sebastian Ott 1 participant 1 message Aug 25, 2009 1 message not in the archive s390

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi,

Quoted 3 lines · Roel Kluin

If the device can't be registered, put_device(&cdev->dev) occured here and after out_err:.

The additional put_device should not be removed.

To register a ccw device we use device_initialize, do some asynchronous recognition and call io_subchannel_register() via a workqueue.
So in io_subchannel_register the refcount should be 2 (1 for the initialization and 1 for workqueue processing). If the device_add fails at this point we drop both references, so that the devices' release function gets called.

Regards,
Sebastian

Quoted 20 lines

---

drivers/s390/cio/device.c +0 -3
index 3c57c1a..8c17757 100644
@@ -999,8 +999,6 @@ io_subchannel_register(struct work_struct *work)
 		spin_lock_irqsave(sch->lock, flags);
 		sch_set_cdev(sch, NULL);
 		spin_unlock_irqrestore(sch->lock, flags);
-		/* Release initial device reference. */
-		put_device(&cdev->dev);
 		goto out_err;
 	}
 out:
--

To unsubscribe from this list: send the line "unsubscribe linux-s390" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html