From: Hannes Reinecke <hare@suse.de>
To: Greg KH <greg@kroah.com>
Cc: hotplug <linux-hotplug-devel@lists.sourceforge.net>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] NULL arg for get_device() / put_device()
Date: Tue, 28 Sep 2004 07:03:21 +0000 [thread overview]
Message-ID: <41590CB9.8060405@suse.de> (raw)
In-Reply-To: <20040928012801.GA11125@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 533 bytes --]
Greg KH wrote:
> On Mon, Sep 27, 2004 at 02:21:49PM +0200, Hannes Reinecke wrote:
>
>>Hi all,
>>
>>is there a specific reason that get_device accepts NULL as argument,
>>whereas put_device() does not?
>
>
> Um, I guess I never thought about it :)
>
> I don't see why it wouldn't take it, feel free to send a patch.
>
Here it is. Please apply.
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux AG S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: null-argument-for-put_device.patch --]
[-- Type: text/x-patch, Size: 694 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/09/28 08:59:54+02:00 hare@lammermuir.suse.de
# Since get_device() accepts a NULL argument, put_device() should do so, too.
#
# Signed-off-by: Hannes Reinecke <hare@suse.de>
#
# drivers/base/core.c
# 2004/09/28 08:59:49+02:00 hare@lammermuir.suse.de +2 -1
# put_device() should accept a NULL argument.
#
diff -Nru a/drivers/base/core.c b/drivers/base/core.c
--- a/drivers/base/core.c 2004-09-28 09:01:20 +02:00
+++ b/drivers/base/core.c 2004-09-28 09:01:20 +02:00
@@ -293,7 +293,8 @@
*/
void put_device(struct device * dev)
{
- kobject_put(&dev->kobj);
+ if (dev)
+ kobject_put(&dev->kobj);
}
WARNING: multiple messages have this Message-ID (diff)
From: Hannes Reinecke <hare@suse.de>
To: Greg KH <greg@kroah.com>
Cc: hotplug <linux-hotplug-devel@lists.sourceforge.net>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] NULL arg for get_device() / put_device()
Date: Tue, 28 Sep 2004 09:03:21 +0200 [thread overview]
Message-ID: <41590CB9.8060405@suse.de> (raw)
In-Reply-To: <20040928012801.GA11125@kroah.com>
[-- Attachment #1: Type: text/plain, Size: 510 bytes --]
Greg KH wrote:
> On Mon, Sep 27, 2004 at 02:21:49PM +0200, Hannes Reinecke wrote:
>
>>Hi all,
>>
>>is there a specific reason that get_device accepts NULL as argument,
>>whereas put_device() does not?
>
>
> Um, I guess I never thought about it :)
>
> I don't see why it wouldn't take it, feel free to send a patch.
>
Here it is. Please apply.
Cheers,
Hannes
--
Dr. Hannes Reinecke hare@suse.de
SuSE Linux AG S390 & zSeries
Maxfeldstraße 5 +49 911 74053 688
90409 Nürnberg http://www.suse.de
[-- Attachment #2: null-argument-for-put_device.patch --]
[-- Type: text/x-patch, Size: 694 bytes --]
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/09/28 08:59:54+02:00 hare@lammermuir.suse.de
# Since get_device() accepts a NULL argument, put_device() should do so, too.
#
# Signed-off-by: Hannes Reinecke <hare@suse.de>
#
# drivers/base/core.c
# 2004/09/28 08:59:49+02:00 hare@lammermuir.suse.de +2 -1
# put_device() should accept a NULL argument.
#
diff -Nru a/drivers/base/core.c b/drivers/base/core.c
--- a/drivers/base/core.c 2004-09-28 09:01:20 +02:00
+++ b/drivers/base/core.c 2004-09-28 09:01:20 +02:00
@@ -293,7 +293,8 @@
*/
void put_device(struct device * dev)
{
- kobject_put(&dev->kobj);
+ if (dev)
+ kobject_put(&dev->kobj);
}
next prev parent reply other threads:[~2004-09-28 7:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-27 12:21 NULL arg for get_device() / put_device() Hannes Reinecke
2004-09-28 1:28 ` Greg KH
2004-09-28 7:03 ` Hannes Reinecke [this message]
2004-09-28 7:03 ` [PATCH] " Hannes Reinecke
2004-09-29 23:27 ` Greg KH
2004-09-29 23:27 ` Greg KH
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=41590CB9.8060405@suse.de \
--to=hare@suse.de \
--cc=greg@kroah.com \
--cc=linux-hotplug-devel@lists.sourceforge.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.