device-display: Add hal_backend_device_display_funcs initialization 76/309076/1
authorYunhee Seo <yuni.seo@samsung.com>
Thu, 4 Apr 2024 08:51:51 +0000 (17:51 +0900)
committerYunhee Seo <yuni.seo@samsung.com>
Thu, 4 Apr 2024 08:51:51 +0000 (17:51 +0900)
When the hal module fails open hal-backend,
after free hal_backend_[module]_funcs structure, it should be initialized by NULL.
Otherwise, there will be an error when approaching above function pointer structure.
To avoid accessing uninitialized value, this is necessary.

Change-Id: Icc0672941d681eafee471724a2cb2c0d49ac6919
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
src/hal-api-device-display.c

index a8969efaba9a740b7a26702c934204da49ffeb90..1025872b48f95ae03dfc5f99861857fdf7f05477 100644 (file)
@@ -36,6 +36,7 @@ int hal_device_display_get_backend(void)
        if (ret < 0) {
                _E("Failed to get device-display backend");
                free(hal_device_display_funcs);
+               hal_device_display_funcs = NULL;
                return -ENOTSUP;
        }