s390/cio: fix memleak in channel measurement
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Mon, 7 Sep 2015 17:52:31 +0000 (19:52 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 14 Oct 2015 12:32:03 +0000 (14:32 +0200)
The measurement block for the extended measurement data is not freed when
switching off per device measurement. Free the measurement block after HW
stopped accessing it.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/cmf.c

index 59b1ac24f9922418f4c56f80820653142310fa30..0d1898e51171bf1bf6f09c4ff7a0f7eb7a4acc47 100644 (file)
@@ -876,8 +876,10 @@ static void free_cmbe(struct ccw_device *cdev)
        spin_lock_irq(cdev->ccwlock);
        cmb_data = cdev->private->cmb;
        cdev->private->cmb = NULL;
-       if (cmb_data)
+       if (cmb_data) {
                kfree(cmb_data->last_block);
+               kfree(cmb_data->hw_block);
+       }
        kfree(cmb_data);
 
        /* deactivate global measurement if this is the last channel */