From: Alexander Nyberg Date: Sat, 26 Feb 2005 12:38:51 +0000 (+0100) Subject: [PATCH] Hotplug: Make dev->bus checking consistent X-Git-Tag: v2.6.12-rc4~133^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=177a4324944478f2799ce4ede2797cb0f602f274;p=linux-2.6 [PATCH] Hotplug: Make dev->bus checking consistent Earlier in the same function dev->bus is checked before dereferenced, make consistent although I honestly don't know if dev->bus could ever be NULL Found by the Coverity tool Signed-off-by: Alexander Nyberg Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/core.c b/drivers/base/core.c index a7cedd8cef..268a9c8d16 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -139,7 +139,7 @@ static int dev_hotplug(struct kset *kset, struct kobject *kobj, char **envp, buffer = &buffer[length]; buffer_size -= length; - if (dev->bus->hotplug) { + if (dev->bus && dev->bus->hotplug) { /* have the bus specific function add its stuff */ retval = dev->bus->hotplug (dev, envp, num_envp, buffer, buffer_size); if (retval) {