Skip to content

Commit

Permalink
[S390] s390/char/vmur.c: fix memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dennis Chen authored and Martin Schwidefsky committed Apr 11, 2012
1 parent cd10502 commit dae1df4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/char/vmur.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit dae1df4

Please sign in to comment.