[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: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by Cornelia Huck and committed by Martin Schwidefsky 85acc407 50bec4ce

+4
+4
drivers/s390/cio/device.c
··· 874 874 replacing_cdev = get_disc_ccwdev_by_dev_id(&dev_id, cdev); 875 875 if (replacing_cdev) { 876 876 sch_attach_disconnected_device(sch, replacing_cdev); 877 + /* Release reference from get_disc_ccwdev_by_dev_id() */ 878 + put_device(&cdev->dev); 877 879 return; 878 880 } 879 881 replacing_cdev = get_orphaned_ccwdev_by_dev_id(css, &dev_id); 880 882 if (replacing_cdev) { 881 883 sch_attach_orphaned_device(sch, replacing_cdev); 884 + /* Release reference from get_orphaned_ccwdev_by_dev_id() */ 885 + put_device(&cdev->dev); 882 886 return; 883 887 } 884 888 sch_create_and_recog_new_device(sch);