linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hdoyu@nvidia.com (Hiroshi DOYU)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC 1/1] Driver Core: don't oops with unregistered driver in driver_find_device()
Date: Thu, 10 May 2012 10:35:02 +0300	[thread overview]
Message-ID: <1336635302-29260-1-git-send-email-hdoyu@nvidia.com> (raw)

driver_find_device() can be called with an unregistered driver. Need
to check driver_private to see if it's populated or not, especially
under deferrable probe.

Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
---
In [PATCHv5 2/3] ARM: tegra: Add SMMU enabler in AHB:
  http://article.gmane.org/gmane.linux.ports.tegra/4658

"tegra_ahb_driver" may not be populated when it's called.
---
 drivers/base/driver.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 3ec3896..207c27d 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -80,7 +80,7 @@ struct device *driver_find_device(struct device_driver *drv,
 	struct klist_iter i;
 	struct device *dev;
 
-	if (!drv)
+	if (!drv || !drv->p)
 		return NULL;
 
 	klist_iter_init_node(&drv->p->klist_devices, &i,
-- 
1.7.5.4

             reply	other threads:[~2012-05-10  7:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-10  7:35 Hiroshi DOYU [this message]
2012-05-10 14:11 ` [RFC 1/1] Driver Core: don't oops with unregistered driver in driver_find_device() Greg Kroah-Hartman
2012-05-10 15:59   ` Stephen Warren
2012-05-10 18:16     ` Greg Kroah-Hartman
2012-05-10 20:00       ` Stephen Warren
2012-05-10 22:28         ` Greg Kroah-Hartman
2012-05-10 22:34           ` Stephen Warren
2012-05-10 22:45             ` Greg Kroah-Hartman
2012-05-11  8:03             ` Hiroshi Doyu

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=1336635302-29260-1-git-send-email-hdoyu@nvidia.com \
    --to=hdoyu@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).