summaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/aim-cdev
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2016-08-22 16:46:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-22 16:41:00 -0400
commit1d9e3a07cb80ca7c8f4efcfcc6c4ca10790d9645 (patch)
treead3381405201c84e5834f66c09c39bcbd9f0051d /drivers/staging/most/aim-cdev
parent88b090e3c020bfeac13d5c52984a03775808cb67 (diff)
downloadlinux-1d9e3a07cb80ca7c8f4efcfcc6c4ca10790d9645.tar.bz2
staging: most: aim-cdev: destroy ida struct in case of exception
This patch is needed to clean up the initialized ida structure in case the function exits with an exception. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most/aim-cdev')
-rw-r--r--drivers/staging/most/aim-cdev/cdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index db6f4586bcaf..1c20ae69c561 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -509,7 +509,7 @@ static int __init mod_init(void)
err = alloc_chrdev_region(&aim_devno, 0, 50, "cdev");
if (err < 0)
- return err;
+ goto dest_ida;
major = MAJOR(aim_devno);
aim_class = class_create(THIS_MODULE, "most_cdev_aim");
@@ -527,6 +527,8 @@ dest_class:
class_destroy(aim_class);
free_cdev:
unregister_chrdev_region(aim_devno, 1);
+dest_ida:
+ ida_destroy(&minor_id);
return err;
}