All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org
Cc: alexn@dsv.su.se
Subject: [PATCH] Hotplug: Make dev->bus checking consistent
Date: Wed, 4 May 2005 23:57:01 -0700	[thread overview]
Message-ID: <11152762214193@kroah.com> (raw)
In-Reply-To: <20050505065609.GA838@kroah.com>

[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 <alexn@dsv.su.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
commit 177a4324944478f2799ce4ede2797cb0f602f274
tree cc42dcdbce1c3b53ea147abd3ebf784f0d2bf1bc
parent 897f5ab2cd733a77a2279268262919caa8154b9d
author Alexander Nyberg <alexn@dsv.su.se> 1109421531 +0100
committer Greg KH <gregkh@suse.de> 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) {


  reply	other threads:[~2005-05-05  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-05  6:56 [GIT PATCH] driver core bugfixes for 2.6.12-rc3 Greg KH
2005-05-05  6:57 ` Greg KH [this message]
2005-05-05  6:57   ` [PATCH] drivers/base/bus.c: fix iteration in driver_detach() 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=11152762214193@kroah.com \
    --to=gregkh@suse.de \
    --cc=alexn@dsv.su.se \
    --cc=greg@kroah.com \
    --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.