aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorchipset/file.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-03-27 15:26:09 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-03 13:43:44 +0200
commit6bdb610142fc0433077e24bb36f90e7c52bcaded (patch)
tree9068a06f94f7096a5328219646b398a2b029e064 /drivers/staging/unisys/visorchipset/file.c
parentstaging: sm750: move assignment out of if cond (diff)
downloadlinux-dev-6bdb610142fc0433077e24bb36f90e7c52bcaded.tar.xz
linux-dev-6bdb610142fc0433077e24bb36f90e7c52bcaded.zip
staging: unisys: unregister chardev on error
after registering the major numbers if the cdev_add fails then we were not releasing the major numbers. now we are doing that. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorchipset/file.c')
-rw-r--r--drivers/staging/unisys/visorchipset/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c
index 39b19afa5169..5c5d35f10471 100644
--- a/drivers/staging/unisys/visorchipset/file.c
+++ b/drivers/staging/unisys/visorchipset/file.c
@@ -65,8 +65,10 @@ visorchipset_file_init(dev_t major_dev, struct visorchannel **controlvm_channel)
return -1;
}
rc = cdev_add(&file_cdev, MKDEV(MAJOR(major_dev), 0), 1);
- if (rc < 0)
+ if (rc < 0) {
+ unregister_chrdev_region(major_dev, 1);
return -1;
+ }
return 0;
}