[PATCH] Hotplug: Make dev->bus checking consistent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
commit 177a4324944478f2799ce4ede2797cb0f602f274
tree cc42dcdbce1c3b53ea147abd3ebf784f0d2bf1bc
parent 897f5ab2cd733a77a2279268262919caa8154b9d
author Alexander Nyberg <[email protected]> 1109421531 +0100
committer Greg KH <[email protected]> 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) {

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux