execute memcpy only success case
authorJunkyeong Kim <jk0430.kim@samsung.com>
Sun, 7 Feb 2021 09:23:59 +0000 (18:23 +0900)
committerJunkyeong Kim <jk0430.kim@samsung.com>
Sun, 7 Feb 2021 09:24:02 +0000 (18:24 +0900)
Change-Id: Ib730cb1dba433bf708743766680bb566ad91e112
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
src/tdm_hwc.c
src/tdm_output.c

index 0c49873..a445fe2 100644 (file)
@@ -1049,7 +1049,8 @@ tdm_hwc_get_property(tdm_hwc *hwc, uint32_t id, tdm_value *value)
        if (private_module->use_hal_tdm) {
                hal_tdm_value hvalue;
                ret = (tdm_error)hal_tdm_hwc_get_property((hal_tdm_hwc *)private_hwc->hwc_backend, id, &hvalue);
-               memcpy(value->ptr, &hvalue.ptr, sizeof(tdm_value));
+               if (ret == TDM_ERROR_NONE)
+                       memcpy(value->ptr, &hvalue.ptr, sizeof(tdm_value));
        } else {
                if (!func_hwc->hwc_get_property) {
                        /* LCOV_EXCL_START */
index bd2afa7..3e1ef1c 100644 (file)
@@ -950,7 +950,8 @@ tdm_output_get_property(tdm_output *output, unsigned int id, tdm_value *value)
        if (private_module->use_hal_tdm) {
                hal_tdm_value hvalue;
                ret = (tdm_error)hal_tdm_output_get_property(private_output->output_backend, id, &hvalue);
-               memcpy(value->ptr, &hvalue.ptr, sizeof(tdm_value));
+               if (ret == TDM_ERROR_NONE)
+                       memcpy(value->ptr, &hvalue.ptr, sizeof(tdm_value));
        } else {
                func_output = &private_module->func_output;