From: Colin Cross Date: Thu, 8 Mar 2012 01:34:37 +0000 (-0800) Subject: staging: android: ram_console: fix crash in ram_console_late_init X-Git-Tag: MMI-PSA29.97-13-9~17268^2~45 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3a21138d3f76296ad070a3692d72eb529e7d5d2c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- 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;