Remove free data section when the module exits 34/310234/1
authorYunhee Seo <yuni.seo@samsung.com>
Wed, 24 Apr 2024 07:47:34 +0000 (16:47 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Wed, 24 Apr 2024 08:14:21 +0000 (17:14 +0900)
In the hal backend module, when the moudle exits, the hal_backend_[module]_funcs was
handled from [module]_exit function.
The data parameter is handed over from hal-api-common put_backend function.
And data is pointing to hal_backend_[module]_funcs, and free by hal-backend module.
As memory release operation moves to the hal-api-device side,
also double free operation is useless, thus it is deleted from hal-backend.

Change-Id: I8b80ce3180e722fbfe0025c509f3228994a20637
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
hw/board/board.c
hw/display/display.c
hw/haptic/gpio.c
hw/led/led.c
hw/memory/memory.c
hw/thermal/thermal.c
hw/touchscreen/touchscreen.c

index 62dbede9cde8067688fe3507f3db213323bce17a..292126d35066365a0c68ae001e10ceef090dbd24 100644 (file)
@@ -309,10 +309,6 @@ static int board_init(void **data)
 
 static int board_exit(void *data)
 {
-       if (!data)
-               return 0;
-
-       free(data);
        return 0;
 }
 
index d4bd4b18a6bb86cd0ec16e376fe0bacde603bf58..059f4335106c4dc87e0e809d204715c339015351 100644 (file)
@@ -120,10 +120,6 @@ static int display_init(void **data)
 
 static int display_exit(void *data)
 {
-       if (!data)
-               return 0;
-
-       free(data);
        return 0;
 }
 
index 488f140bbec26dedac15002fcf77051b0330e39e..ecd82a5c6982f0774f76f3eb4f6567b7f7ca9190 100644 (file)
@@ -338,10 +338,6 @@ static int haptic_init(void **data)
 
 static int haptic_exit(void *data)
 {
-    if (!data)
-        return -EINVAL;
-
-    free(data);
     return 0;
 }
 
index 8773adaa65ef4a866d68aaeefb013cdd7bb72613..92bb67bb6f97e526749a4f87976c1a7fcb62032b 100644 (file)
@@ -366,9 +366,6 @@ static int led_exit(void *data)
 {
        hal_backend_device_led_funcs *led_device;
 
-       if (!data)
-               return 0;
-
        led_device = (hal_backend_device_led_funcs *)data;
        free(led_device->notification);
 
index 07bd686f70991d92380ff4cb9252eb9ec14ba7b6..3347d23f3df34c78d47fcf36396bb998a31f188a 100644 (file)
@@ -108,7 +108,6 @@ static int memory_init(void **data)
 
 static int memory_exit(void *data)
 {
-       free(data);
        return 0;
 }
 
index 49dd8585b71631fd0fd82af1cb3b884adac32c03..fb59d28524faa6cd52fe6fd92241d454dfee510d 100644 (file)
@@ -136,10 +136,6 @@ static int thermal_init(void **data)
 
 static int thermal_exit(void *data)
 {
-       if (!data)
-               return 0;
-
-       free(data);
        return 0;
 }
 
index 3d718e2a058f1f68c365ed7fcc2b32ce7f8a5227..cf732934a6b2f930c33ba46167782ca6d2f5bf9e 100644 (file)
@@ -118,10 +118,6 @@ static int touchscreen_init(void **data)
 
 static int touchscreen_exit(void *data)
 {
-       if (!data)
-               return 0;
-
-       free(data);
        return 0;
 }