alexn@dsv.su.se [PATCH] Hotplug: Make dev->bus checking consistent [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 --- commit 177a4324944478f2799ce4ede2797cb0f602f274 tree cc42dcdbce1c3b53ea147abd3ebf784f0d2bf1bc parent 897f5ab2cd733a77a2279268262919caa8154b9d author Alexander Nyberg 1109421531 +0100 committer Greg KH 1115275477 -0700 Index: drivers/base/core.c =================================================================== --- 95866d31faa6db4ec786399296238344c7cfea0c/drivers/base/core.c (mode:100644 sha1:a7cedd8cefe5385a8d2eb6f334c8661454c443d7) +++ cc42dcdbce1c3b53ea147abd3ebf784f0d2bf1bc/drivers/base/core.c (mode:100644 sha1:268a9c8d168b6ac72a46e0c624830b030b79df51) @@ -139,7 +139,7 @@ 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) {