summaryrefslogtreecommitdiff
path: root/drivers/uio/uio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uio/uio.c')
-rw-r--r--drivers/uio/uio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index effe72834c2f..f23ef235359f 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -940,8 +940,10 @@ int __uio_register_device(struct module *owner,
atomic_set(&idev->event, 0);
ret = uio_get_minor(idev);
- if (ret)
+ if (ret) {
+ kfree(idev);
return ret;
+ }
idev->dev.devt = MKDEV(uio_major, idev->minor);
idev->dev.class = &uio_class;