From 3a21138d3f76296ad070a3692d72eb529e7d5d2c Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 7 Mar 2012 17:34:37 -0800 Subject: [PATCH] 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 Signed-off-by: Colin Cross Signed-off-by: John Stultz Signed-off-by: Greg Kroah-Hartman --- drivers/staging/android/ram_console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c index 29d347e802ed..d956b8441442 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; -- 2.20.1