Commit 74b6127e authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

[S390] cio: fix memleak in resume path

If a ccwdevice is lost during hibernation and a different
ccwdevice is attached to the same subchannel, we will
deregister the old ccw device and register the new one.

Since deregistration is not allowed in this context, we
handle this action later. However, some parts of the
registration process for the new device were started anyway,
so that the old device structure is no longer accessible.

Fix this by deferring both actions to the afterwards
scheduled subchannel event.
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f2777077
...@@ -1468,8 +1468,12 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process) ...@@ -1468,8 +1468,12 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
goto out; goto out;
break; break;
case IO_SCH_UNREG_ATTACH: case IO_SCH_UNREG_ATTACH:
if (cdev->private->flags.resuming) {
/* Device will be handled later. */
rc = 0;
goto out;
}
/* Unregister ccw device. */ /* Unregister ccw device. */
if (!cdev->private->flags.resuming)
ccw_device_unregister(cdev); ccw_device_unregister(cdev);
break; break;
default: default:
......
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