aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Ott <sebott@linux.vnet.ibm.com>2010-10-25 10:10:26 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-10-25 10:10:18 -0400
commit74b6127e6c35abf06364468636dd261850639f8b (patch)
treee3519c8672226e7951ade85c3efd670bea356415
parentf2777077aa1f6f8a7c76b83f240975289a9fb894 (diff)
[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: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/cio/device.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 51bd3687d163..07b1a074beaf 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -1468,9 +1468,13 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
1468 goto out; 1468 goto out;
1469 break; 1469 break;
1470 case IO_SCH_UNREG_ATTACH: 1470 case IO_SCH_UNREG_ATTACH:
1471 if (cdev->private->flags.resuming) {
1472 /* Device will be handled later. */
1473 rc = 0;
1474 goto out;
1475 }
1471 /* Unregister ccw device. */ 1476 /* Unregister ccw device. */
1472 if (!cdev->private->flags.resuming) 1477 ccw_device_unregister(cdev);
1473 ccw_device_unregister(cdev);
1474 break; 1478 break;
1475 default: 1479 default:
1476 break; 1480 break;