From: Huang, Tao Date: Tue, 1 Dec 2015 12:15:01 +0000 (+0800) Subject: block/partitions/rk: fix panic when cmdline without mtdparts X-Git-Tag: firefly_0821_release~3568 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b76c56efde358b76069ed64b44bd39066476005b;p=firefly-linux-kernel-4.4.55.git block/partitions/rk: fix panic when cmdline without mtdparts Change-Id: I1a3b052ac671ce4abddaf941373f38c11193f0d4 Signed-off-by: Huang, Tao --- diff --git a/block/partitions/rk.c b/block/partitions/rk.c index 0a20ababa44b..76f72002134c 100755 --- a/block/partitions/rk.c +++ b/block/partitions/rk.c @@ -305,7 +305,10 @@ int rkpart_partition(struct parsed_partitions *state) return 0; /* Fixme: parameter should be coherence with part table */ - cmdline = strstr(saved_command_line, "mtdparts=") + 9; + cmdline = strstr(saved_command_line, "mtdparts="); + if (!cmdline) + return 0; + cmdline += 9; cmdline_parsed = 0; num_parts = parse_cmdline_partitions(n, &parts, 0);