Skip to content

Commit

Permalink
Merge tag 'omap-for-v4.2/fixes-rc6' of git://git.kernel.org/pub/scm/l…
Browse files Browse the repository at this point in the history
…inux/kernel/git/tmlind/linux-omap into fixes

Fix a NULL pointer exception for omap GPMC bus code if probe fails.

* tag 'omap-for-v4.2/fixes-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  memory: omap-gpmc: Don't try to save uninitialized GPMC context

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Aug 13, 2015
2 parents db55350 + e984a17 commit 659181a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/memory/omap-gpmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,9 @@ void omap3_gpmc_save_context(void)
{
int i;

if (!gpmc_base)
return;

gpmc_context.sysconfig = gpmc_read_reg(GPMC_SYSCONFIG);
gpmc_context.irqenable = gpmc_read_reg(GPMC_IRQENABLE);
gpmc_context.timeout_ctrl = gpmc_read_reg(GPMC_TIMEOUT_CONTROL);
Expand Down Expand Up @@ -2277,6 +2280,9 @@ void omap3_gpmc_restore_context(void)
{
int i;

if (!gpmc_base)
return;

gpmc_write_reg(GPMC_SYSCONFIG, gpmc_context.sysconfig);
gpmc_write_reg(GPMC_IRQENABLE, gpmc_context.irqenable);
gpmc_write_reg(GPMC_TIMEOUT_CONTROL, gpmc_context.timeout_ctrl);
Expand Down

0 comments on commit 659181a

Please sign in to comment.