pass-hal: standard: Fix svace warnings 80/253780/1 accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.5/unified/20211028.094025 accepted/tizen/7.0/unified/20221110.062035 accepted/tizen/7.0/unified/hotfix/20221116.104452 accepted/tizen/8.0/unified/20231005.092513 accepted/tizen/unified/20210218.082027 submit/tizen/20210218.030331 submit/tizen_6.5/20211028.161501 tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 18 Feb 2021 02:57:52 +0000 (11:57 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 18 Feb 2021 02:57:52 +0000 (11:57 +0900)
Change-Id: I35cff46ff50908a9f2a861f0982744fea9a5fce8
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal-backend-power.c

index aa4f686..c4f52ad 100644 (file)
@@ -682,26 +682,26 @@ static int power_init(void **data)
 
        cpu = calloc(1, sizeof(struct pass_resource_cpu));
        if (!cpu) {
-               return -ENOMEM;
-               goto err;
+               ret = -ENOMEM;
+               goto err_funcs;
        }
 
        bus = calloc(1, sizeof(struct pass_resource_bus));
        if (!bus) {
-               return -ENOMEM;
-               goto err;
+               ret = -ENOMEM;
+               goto err_cpu;
        }
 
        gpu = calloc(1, sizeof(struct pass_resource_gpu));
        if (!gpu) {
-               return -ENOMEM;
-               goto err;
+               ret = -ENOMEM;
+               goto err_bus;
        }
 
        memory = calloc(1, sizeof(struct pass_resource_memory));
        if (!memory) {
                ret = -ENOMEM;
-               goto err;
+               goto err_gpu;
        }
 
        /* Initialize each h/w resource */
@@ -727,16 +727,17 @@ static int power_init(void **data)
        *data = (void *)power_funcs;
 
        return 0;
-err:
-       if (memory)
-               free(memory);
+
+err_gpu:
        if (gpu)
                free(gpu);
+err_bus:
        if (bus)
                free(bus);
+err_cpu:
        if (cpu)
                free(cpu);
-
+err_funcs:
        free(power_funcs);
 
        return ret;