diff options
author | Colin Cross <ccross@android.com> | 2012-03-08 01:34:37 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-08 17:37:09 (GMT) |
commit | 3a21138d3f76296ad070a3692d72eb529e7d5d2c (patch) | |
tree | fb4f461b4df1709ce06320256d76d7fdcc75c9d9 /drivers/staging | |
parent | a15d0b365e9bbf04dacb44fbe69d15f6594460e1 (diff) | |
download | linux-fsl-qoriq-3a21138d3f76296ad070a3692d72eb529e7d5d2c.tar.xz |
staging: android: ram_console: fix crash in ram_console_late_init
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/android/ram_console.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c index 29d347e..d956b84 100644 --- a/drivers/staging/android/ram_console.c +++ b/drivers/staging/android/ram_console.c @@ -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; |