From: Yunhee Seo Date: Wed, 24 Apr 2024 07:47:34 +0000 (+0900) Subject: Remove free data section when the module exits X-Git-Tag: accepted/tizen/unified/20240614.084953~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eeb0fed483346ee087cd3bbeddd59bd165ff3460;p=platform%2Fhal%2Fbackend%2Frpi%2Fdevice-rpi.git Remove free data section when the module exits 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 --- diff --git a/hw/board/board.c b/hw/board/board.c index 62dbede..292126d 100644 --- a/hw/board/board.c +++ b/hw/board/board.c @@ -309,10 +309,6 @@ static int board_init(void **data) static int board_exit(void *data) { - if (!data) - return 0; - - free(data); return 0; } diff --git a/hw/display/display.c b/hw/display/display.c index d4bd4b1..059f433 100644 --- a/hw/display/display.c +++ b/hw/display/display.c @@ -120,10 +120,6 @@ static int display_init(void **data) static int display_exit(void *data) { - if (!data) - return 0; - - free(data); return 0; } diff --git a/hw/haptic/gpio.c b/hw/haptic/gpio.c index 488f140..ecd82a5 100644 --- a/hw/haptic/gpio.c +++ b/hw/haptic/gpio.c @@ -338,10 +338,6 @@ static int haptic_init(void **data) static int haptic_exit(void *data) { - if (!data) - return -EINVAL; - - free(data); return 0; } diff --git a/hw/led/led.c b/hw/led/led.c index 8773ada..92bb67b 100644 --- a/hw/led/led.c +++ b/hw/led/led.c @@ -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); diff --git a/hw/memory/memory.c b/hw/memory/memory.c index 07bd686..3347d23 100644 --- a/hw/memory/memory.c +++ b/hw/memory/memory.c @@ -108,7 +108,6 @@ static int memory_init(void **data) static int memory_exit(void *data) { - free(data); return 0; } diff --git a/hw/thermal/thermal.c b/hw/thermal/thermal.c index 49dd858..fb59d28 100644 --- a/hw/thermal/thermal.c +++ b/hw/thermal/thermal.c @@ -136,10 +136,6 @@ static int thermal_init(void **data) static int thermal_exit(void *data) { - if (!data) - return 0; - - free(data); return 0; } diff --git a/hw/touchscreen/touchscreen.c b/hw/touchscreen/touchscreen.c index 3d718e2..cf73293 100644 --- a/hw/touchscreen/touchscreen.c +++ b/hw/touchscreen/touchscreen.c @@ -118,10 +118,6 @@ static int touchscreen_init(void **data) static int touchscreen_exit(void *data) { - if (!data) - return 0; - - free(data); return 0; }