* [PATCH] RAW driver: Remove call to kobject_put().
@ 2011-05-04 9:19 Robert P. J. Day
0 siblings, 0 replies; 2+ messages in thread
From: Robert P. J. Day @ 2011-05-04 9:19 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: Greg KH
If cdev_add() fails, there is no justification for subsequently
calling kobject_put().
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
---
argh, earlier submission had equal signs rather than hyphens for
marker line. my mistake, so this is just a resubmit. sorry.
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index b4b9d5a..e2b4829 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -319,7 +319,6 @@ static int __init raw_init(void)
cdev_init(&raw_cdev, &raw_fops);
ret = cdev_add(&raw_cdev, dev, MAX_RAW_MINORS);
if (ret) {
- kobject_put(&raw_cdev.kobj);
goto error_region;
}
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] RAW driver: Remove call to kobject_put().
@ 2011-05-04 1:28 Robert P. J. Day
0 siblings, 0 replies; 2+ messages in thread
From: Robert P. J. Day @ 2011-05-04 1:28 UTC (permalink / raw)
To: Linux Kernel Mailing List; +Cc: Greg KH
If cdev_add() fails, there is no justification for subsequently
calling kobject_put().
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
===
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index b4b9d5a..e2b4829 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -319,7 +319,6 @@ static int __init raw_init(void)
cdev_init(&raw_cdev, &raw_fops);
ret = cdev_add(&raw_cdev, dev, MAX_RAW_MINORS);
if (ret) {
- kobject_put(&raw_cdev.kobj);
goto error_region;
}
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-04 9:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-04 9:19 [PATCH] RAW driver: Remove call to kobject_put() Robert P. J. Day
-- strict thread matches above, loose matches on Subject: below --
2011-05-04 1:28 Robert P. J. Day
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®