From b76c56efde358b76069ed64b44bd39066476005b Mon Sep 17 00:00:00 2001 From: "Huang, Tao" Date: Tue, 1 Dec 2015 20:15:01 +0800 Subject: [PATCH] block/partitions/rk: fix panic when cmdline without mtdparts Change-Id: I1a3b052ac671ce4abddaf941373f38c11193f0d4 Signed-off-by: Huang, Tao --- block/partitions/rk.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- 2.34.1