if (replacing_cdev) {
sch_attach_disconnected_device(sch, replacing_cdev);
/* Release reference from get_disc_ccwdev_by_dev_id() */
- put_device(&cdev->dev);
+ put_device(&replacing_cdev->dev);
return;
}
replacing_cdev = get_orphaned_ccwdev_by_dev_id(css, &dev_id);
if (replacing_cdev) {
sch_attach_orphaned_device(sch, replacing_cdev);
/* Release reference from get_orphaned_ccwdev_by_dev_id() */
- put_device(&cdev->dev);
+ put_device(&replacing_cdev->dev);
return;
}
sch_create_and_recog_new_device(sch);