diff options
author | Yunhee Seo <yuni.seo@samsung.com> | 2024-04-24 16:47:34 +0900 |
---|---|---|
committer | Yunhee Seo <yuni.seo@samsung.com> | 2024-04-24 17:14:21 +0900 |
commit | eeb0fed483346ee087cd3bbeddd59bd165ff3460 (patch) | |
tree | ff38a0b386fc7a285b287f82cb0b52b6b9276f78 | |
parent | 2b9f809d516eb839fb37ebacef9f24b287d80ce3 (diff) | |
download | device-rpi-eeb0fed483346ee087cd3bbeddd59bd165ff3460.tar.gz device-rpi-eeb0fed483346ee087cd3bbeddd59bd165ff3460.tar.bz2 device-rpi-eeb0fed483346ee087cd3bbeddd59bd165ff3460.zip |
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 <yuni.seo@samsung.com>
-rw-r--r-- | hw/board/board.c | 4 | ||||
-rw-r--r-- | hw/display/display.c | 4 | ||||
-rw-r--r-- | hw/haptic/gpio.c | 4 | ||||
-rw-r--r-- | hw/led/led.c | 3 | ||||
-rw-r--r-- | hw/memory/memory.c | 1 | ||||
-rw-r--r-- | hw/thermal/thermal.c | 4 | ||||
-rw-r--r-- | hw/touchscreen/touchscreen.c | 4 |
7 files changed, 0 insertions, 24 deletions
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; } |