public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] staging: unisys: unregister chardev on error
@ 2015-03-27  8:30 Sudip Mukherjee
  2015-03-27  8:30 ` [PATCH 2/3] staging: unisys: use error codes Sudip Mukherjee
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Sudip Mukherjee @ 2015-03-27  8:30 UTC (permalink / raw)
  To: Benjamin Romer, David Kershner, Greg Kroah-Hartman
  Cc: sparmaintainer, devel, linux-kernel, Sudip Mukherjee

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>
---
 drivers/staging/unisys/visorchipset/file.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c
index 39b19af..074c285 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;
 }
 
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-27  9:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-27  8:30 [PATCH 1/3] staging: unisys: unregister chardev on error Sudip Mukherjee
2015-03-27  8:30 ` [PATCH 2/3] staging: unisys: use error codes Sudip Mukherjee
2015-03-27  8:47   ` Greg Kroah-Hartman
2015-03-27  9:45     ` Sudip Mukherjee
2015-03-27  8:30 ` [PATCH 3/3] staging: unisys: remove forward declaration Sudip Mukherjee
2015-03-27  8:46 ` [PATCH 1/3] staging: unisys: unregister chardev on error Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox