]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[S390] s390/char/vmur.c: fix memory leak
authorDennis Chen <dennis1.chen@amd.com>
Wed, 11 Apr 2012 12:28:05 +0000 (14:28 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 11 Apr 2012 12:28:24 +0000 (14:28 +0200)
This patch is used to fix a memory leak issue in s390/char/vmur.c.
A character device instance is allocated by cdev_alloc, the cdev_del
will not free that space if cdev_init is applied before.

Signed-off-by: Dennis Chen <dennis1.chen@amd.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/vmur.c

index 85f4a9a5d12e5d00a7e445bd1e1e0a784eaf7cd0..73bef0bd394cab2df006f64bf5e3c25ecce7bb3f 100644 (file)
@@ -903,7 +903,7 @@ static int ur_set_online(struct ccw_device *cdev)
                goto fail_urdev_put;
        }
 
-       cdev_init(urd->char_device, &ur_fops);
+       urd->char_device->ops = &ur_fops;
        urd->char_device->dev = MKDEV(major, minor);
        urd->char_device->owner = ur_fops.owner;