pass-hal: rpi: Fix svace warnings 82/253782/1 accepted/tizen/unified/20210218.082042 submit/tizen/20210218.030331
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 18 Feb 2021 03:09:22 +0000 (12:09 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 18 Feb 2021 03:09:22 +0000 (12:09 +0900)
Change-Id: I50d416383d832ef2430c313f46923a0c9593cb85
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal-backend-power.c

index 00a4dd88969861a94afcc68829031e26a3407da6..e87b27f4fd74b6040bce2856deb3033aca8a997c 100644 (file)
@@ -358,14 +358,14 @@ static int power_rpi4_init(void **data)
 
        cpu = calloc(1, sizeof(struct pass_resource_cpu));
        if (!cpu) {
-               return -ENOMEM;
-               goto err;
+               ret = -ENOMEM;
+               goto err_funcs;
        }
 
        memory = calloc(1, sizeof(struct pass_resource_memory));
        if (!memory) {
                ret = -ENOMEM;
-               goto err;
+               goto err_cpu;
        }
 
        /* Initialize each h/w resource */
@@ -382,12 +382,10 @@ static int power_rpi4_init(void **data)
        *data = (void *)power_funcs;
 
        return 0;
-err:
-       if (memory)
-               free(memory);
+err_cpu:
        if (cpu)
                free(cpu);
-
+err_funcs:
        free(power_funcs);
 
        return ret;