From: Olaf Hering <olh@suse.de>
To: Greg Kroah-Hartman <gregkh@suse.de>, linux-kernel@vger.kernel.org
Subject: [PATCH] PHYSDEVDRIVER=<NULL>
Date: Thu, 17 Feb 2005 15:08:58 +0100 [thread overview]
Message-ID: <20050217140858.GA32212@suse.de> (raw)
For some reasons, PHYSDEVDRIVER can be <NULL> for block events.
So just check for that.
base/class.c | 4 ++--
base/core.c | 4 ++--
block/genhd.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
Signed-off-by: Olaf Hering <olh@suse.de>
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/base/class.c ./drivers/base/class.c
--- ../linux-2.6.11-rc4.orig/drivers/base/class.c 2005-02-13 04:08:06.000000000 +0100
+++ ./drivers/base/class.c 2005-02-17 14:42:56.000000000 +0100
@@ -314,13 +314,13 @@ static int class_hotplug(struct kset *ks
kfree(path);
/* add bus name of physical device */
- if (dev->bus)
+ if (dev->bus && dev->bus->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVBUS=%s", dev->bus->name);
/* add driver name of physical device */
- if (dev->driver)
+ if (dev->driver && dev->driver->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVDRIVER=%s", dev->driver->name);
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/base/core.c ./drivers/base/core.c
--- ../linux-2.6.11-rc4.orig/drivers/base/core.c 2005-02-13 04:05:10.000000000 +0100
+++ ./drivers/base/core.c 2005-02-17 14:42:08.000000000 +0100
@@ -121,13 +121,13 @@ static int dev_hotplug(struct kset *kset
int retval = 0;
/* add bus name of physical device */
- if (dev->bus)
+ if (dev->bus && dev->bus->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVBUS=%s", dev->bus->name);
/* add driver name of physical device */
- if (dev->driver)
+ if (dev->driver && dev->driver->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVDRIVER=%s", dev->driver->name);
diff -purNx tags ../linux-2.6.11-rc4.orig/drivers/block/genhd.c ./drivers/block/genhd.c
--- ../linux-2.6.11-rc4.orig/drivers/block/genhd.c 2005-02-13 04:06:23.000000000 +0100
+++ ./drivers/block/genhd.c 2005-02-17 14:43:26.000000000 +0100
@@ -453,13 +453,13 @@ static int block_hotplug(struct kset *ks
kfree(path);
/* add bus name of physical device */
- if (dev->bus)
+ if (dev->bus && dev->bus->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVBUS=%s", dev->bus->name);
/* add driver name of physical device */
- if (dev->driver)
+ if (dev->driver && dev->driver->name)
add_hotplug_env_var(envp, num_envp, &i,
buffer, buffer_size, &length,
"PHYSDEVDRIVER=%s", dev->driver->name);
next reply other threads:[~2005-02-17 14:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-17 14:08 Olaf Hering [this message]
2005-02-17 17:31 ` [PATCH] PHYSDEVDRIVER=<NULL> Greg KH
2005-02-17 18:07 ` Olaf Hering
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=20050217140858.GA32212@suse.de \
--to=olh@suse.de \
--cc=gregkh@suse.de \
--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