Commit 85acc407 authored by Cornelia Huck's avatar Cornelia Huck Committed by Martin Schwidefsky
Browse files

[S390] cio: Fix refcount after moving devices.

In ccw_device_move_to_orphanage(), a replacing ccw_device
is searched via get_{disc,orphaned}_ccwdev_by_dev_id()
which obtain a reference on the returned ccw_device.
This reference must be given up again after the device
has been moved to its new parent.
Signed-off-by: default avatarCornelia Huck <>
Signed-off-by: default avatarMartin Schwidefsky <>
parent 50bec4ce
...@@ -874,11 +874,15 @@ void ccw_device_move_to_orphanage(struct work_struct *work) ...@@ -874,11 +874,15 @@ void ccw_device_move_to_orphanage(struct work_struct *work)
replacing_cdev = get_disc_ccwdev_by_dev_id(&dev_id, cdev); replacing_cdev = get_disc_ccwdev_by_dev_id(&dev_id, cdev);
if (replacing_cdev) { if (replacing_cdev) {
sch_attach_disconnected_device(sch, replacing_cdev); sch_attach_disconnected_device(sch, replacing_cdev);
/* Release reference from get_disc_ccwdev_by_dev_id() */
return; return;
} }
replacing_cdev = get_orphaned_ccwdev_by_dev_id(css, &dev_id); replacing_cdev = get_orphaned_ccwdev_by_dev_id(css, &dev_id);
if (replacing_cdev) { if (replacing_cdev) {
sch_attach_orphaned_device(sch, replacing_cdev); sch_attach_orphaned_device(sch, replacing_cdev);
/* Release reference from get_orphaned_ccwdev_by_dev_id() */
return; return;
} }
sch_create_and_recog_new_device(sch); sch_create_and_recog_new_device(sch);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment