From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Greg KH <greg@kroah.com>
Subject: [PATCH] RAW driver: Remove call to kobject_put().
Date: Wed, 4 May 2011 05:19:34 -0400 (EDT) [thread overview]
Message-ID: <alpine.DEB.2.00.1105040519250.4439@localhost6.localdomain6> (raw)
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
========================================================================
next reply other threads:[~2011-05-04 9:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 9:19 Robert P. J. Day [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-05-04 1:28 Robert P. J. Day
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.00.1105040519250.4439@localhost6.localdomain6 \
--to=rpjday@crashcourse.ca \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®