]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/s390/cio/device.c
[S390] cio: fix memleak in resume path
[~shefty/rdma-dev.git] / drivers / s390 / cio / device.c
index 51bd3687d163fa3dfcce9454211aaa1ad654a328..07b1a074beaff1562481ec5eb1ba5e5bfd1085ef 100644 (file)
@@ -1468,9 +1468,13 @@ static int io_subchannel_sch_event(struct subchannel *sch, int process)
                        goto out;
                break;
        case IO_SCH_UNREG_ATTACH:
+               if (cdev->private->flags.resuming) {
+                       /* Device will be handled later. */
+                       rc = 0;
+                       goto out;
+               }
                /* Unregister ccw device. */
-               if (!cdev->private->flags.resuming)
-                       ccw_device_unregister(cdev);
+               ccw_device_unregister(cdev);
                break;
        default:
                break;