codec_mm: config: fixed config error crash bug.
authorZhi Zhou <zhi.zhou@amlogic.com>
Fri, 22 Jun 2018 04:43:20 +0000 (12:43 +0800)
committerZhi Zhou <zhi.zhou@amlogic.com>
Tue, 17 Jul 2018 02:07:15 +0000 (19:07 -0700)
PD#166937:
not return errors when not find config.
will crashed on:
[    9.478046@0] task: ffffffc05aea8d80 task.stack: ffffffc05a498000
[    9.484090@0] PC is at configs_config2str+0x2c/0x240
[    9.489001@0] LR is at configs_get_node_path_str+0x78/0xd4
[    9.494433@0] pc : [<ffffff800982f8cc>] lr : [<ffffff80098311c8>]
pstate: 20000145
[    9.501935@0] sp : ffffffc05a49baf0
[    9.505386@0] x29: ffffffc05a49baf0 x28: ffffffc05a498000

Change-Id: Ia5985d3e5aa7aefecb6867e3d2ab29efc7592b9b
Signed-off-by: Zhi Zhou <zhi.zhou@amlogic.com>
drivers/amlogic/media/common/codec_mm/configs/configs.c

index 87fbb8c..16b7d91 100644 (file)
@@ -786,6 +786,7 @@ static int configs_get_node_path_config(
                        if (node == NULL) {
                                if (parent_node != root_node) {
                                        node = parent_node;
+                                       err = -EPERM;
                                        goto out;
                                }
                                /*for reset refs. */