linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: linux-omap <linux-omap@vger.kernel.org>
Cc: Nishanth Menon <nm@ti.com>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	Thara Gopinath <thara@ti.com>
Subject: [PM-SR] [PATCH 6/7] omap3: sr: device: check for dev_attr
Date: Fri, 25 Jun 2010 16:46:39 -0500	[thread overview]
Message-ID: <1277502400-9915-7-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1277502400-9915-1-git-send-email-nm@ti.com>

in the unlikely case that hwmod database is messed up, dont crash
report error and attempt to recover.

Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Thara Gopinath <thara@ti.com>

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/sr_device.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c
index 177299a..81d2532 100644
--- a/arch/arm/mach-omap2/sr_device.c
+++ b/arch/arm/mach-omap2/sr_device.c
@@ -131,6 +131,12 @@ static int sr_dev_init(struct omap_hwmod *oh, void *user)
 	}
 
 	sr_dev_data = (struct omap_sr_dev_data *)oh->dev_attr;
+	if (unlikely(!sr_dev_data)) {
+		pr_err("%s: Bad oh->dev_attr!\n", __func__);
+		kfree(sr_data);
+		return -EINVAL;
+	}
+
 	/*
 	 * OMAP3430 ES3.1 chips by default come with Efuse burnt
 	 * with parameters required for full functionality of
-- 
1.6.3.3


  parent reply	other threads:[~2010-06-25 21:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-25 21:46 [PM-SR] [PATCH 0/7] Janitor series 2: cleanups Nishanth Menon
2010-06-25 21:46 ` [PM-SR] [PATCH 1/7] omap3: voltage: cleanup pr_xxxx Nishanth Menon
2010-06-25 21:46 ` [PM-SR] [PATCH 2/7] omap3: sr: cleanup pr_xxx Nishanth Menon
2010-06-25 21:46 ` [PM-SR] [PATCH 3/7] omap3: sr: enable/disable sr only if required Nishanth Menon
2010-06-25 21:46 ` [PM-SR] [PATCH 4/7] omap3: sr: device: cleanup pr_xxx Nishanth Menon
2010-06-25 21:46 ` [PM-SR] [PATCH 5/7] omap3: sr: device: add unlikely checks Nishanth Menon
2010-07-09 13:12   ` Artem Bityutskiy
2010-07-09 13:40     ` Nishanth Menon
2010-07-09 14:15       ` Artem Bityutskiy
2010-07-09 14:23         ` Nishanth Menon
2010-06-25 21:46 ` Nishanth Menon [this message]
2010-06-25 21:46 ` [PM-SR] [PATCH 7/7] omap3: sr: device: fail sr_dev_init should return error Nishanth Menon

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=1277502400-9915-7-git-send-email-nm@ti.com \
    --to=nm@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=thara@ti.com \
    /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).