Skip to content

Commit

Permalink
staging: android: ram_console: fix crash in ram_console_late_init
Browse files Browse the repository at this point in the history
If the persistent ram buffer is not available, ram_console_late_init
would crash when dereferencing ram_console_zone.  Return early if
ram console was not initialized.

CC: Android Kernel Team <kernel-team@android.com>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Colin Cross authored and Greg Kroah-Hartman committed Mar 8, 2012
1 parent a15d0b3 commit 3a21138
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/staging/android/ram_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ static int __init ram_console_late_init(void)
struct proc_dir_entry *entry;
struct persistent_ram_zone *prz = ram_console_zone;

if (!prz)
return 0;

if (persistent_ram_old_size(prz) == 0)
return 0;

Expand Down

0 comments on commit 3a21138

Please sign in to comment.