diff mbox

SDRC: prevent null pointer dereference if sdrc_init_params is null

Message ID alpine.DEB.2.00.0903231841030.4676@utopia.booyaka.com (mailing list archive)
State Accepted
Commit c4df5a4d436bc3aea65cc665025d5ce62c8dfe09
Headers show

Commit Message

Paul Walmsley March 24, 2009, 12:41 a.m. UTC
omap2_sdrc_get_params() should check to see if a board-*.c file has
called omap2_init_common_hw() with a null pointer for the
omap_sdrc_params argument, rather than attempting to dereference it.
Otherwise, boot will fail after the "Reprogramming SDRC" boot message.
Problem found by Peter Barada <peterb@logicpd.com>.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Tested-by: Peter Barada <peterb@logicpd.com>
---
 arch/arm/mach-omap2/sdrc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Tony Lindgren March 25, 2009, 12:35 a.m. UTC | #1
This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Commit: c4df5a4d436bc3aea65cc665025d5ce62c8dfe09

PatchWorks
http://patchwork.kernel.org/patch/13863/

Git
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=c4df5a4d436bc3aea65cc665025d5ce62c8dfe09


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-omap2/sdrc.c b/arch/arm/mach-omap2/sdrc.c
index 7da6587..993fd25 100644
--- a/arch/arm/mach-omap2/sdrc.c
+++ b/arch/arm/mach-omap2/sdrc.c
@@ -56,6 +56,9 @@  struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r)
 {
 	struct omap_sdrc_params *sp;
 
+	if (!sdrc_init_params)
+		return NULL;
+
 	sp = sdrc_init_params;
 
 	while (sp->rate && sp->rate != r)