pass-hal: tm1: Fix svace warning 79/253779/1 accepted/tizen/unified/20210218.082034 submit/tizen/20210218.030331
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 18 Feb 2021 02:50:06 +0000 (11:50 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 18 Feb 2021 02:50:06 +0000 (11:50 +0900)
Change-Id: I35623dfb144e21e5e285a814b1e61a909ae10deb
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal-backend-power.c

index dd7104910dd886d07de9834ead19f9ae8f8653c7..85b76363f754ae0f6e781489c12974f2384c4a6e 100644 (file)
@@ -326,14 +326,14 @@ static int power_tm1_init(void **data)
 
        cpu = calloc(1, sizeof(struct pass_resource_cpu));
        if (!cpu) {
-               return -ENOMEM;
-               goto err;
+               ret = -ENOMEM;
+               goto err_funcs;
        }
 
        nonstandard = calloc(1, sizeof(struct pass_resource_nonstandard));
        if (!nonstandard) {
                ret = -ENOMEM;
-               goto err;
+               goto err_cpu;
        }
 
        /* Initialize each h/w resource */
@@ -354,12 +354,10 @@ static int power_tm1_init(void **data)
        *data = (void *)funcs;
 
        return 0;
-err:
-       if (nonstandard)
-               free(nonstandard);
+err_cpu:
        if (cpu)
                free(cpu);
-
+err_funcs:
        free(funcs);
 
        return ret;