Commit c4df5a4d authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

SDRC: prevent null pointer dereference if sdrc_init_params is null

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: default avatarPaul Walmsley <paul@pwsan.com>
Tested-by: default avatarPeter Barada <peterb@logicpd.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 7b2a455b
...@@ -56,6 +56,9 @@ struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r) ...@@ -56,6 +56,9 @@ struct omap_sdrc_params *omap2_sdrc_get_params(unsigned long r)
{ {
struct omap_sdrc_params *sp; struct omap_sdrc_params *sp;
if (!sdrc_init_params)
return NULL;
sp = sdrc_init_params; sp = sdrc_init_params;
while (sp->rate && sp->rate != r) while (sp->rate && sp->rate != r)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment