From: Taehwan Kim Date: Wed, 13 Feb 2013 01:46:12 +0000 (+0000) Subject: libcsc: resolved prevent defects X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4614f049a05a03abf87b8160534ebd6b778b45d2;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung_slsi_exynos.git libcsc: resolved prevent defects 1. 16490 : Incorrect expression 2. 17724 : Null pointer dereferences Change-Id: I39b9e9433f19aba7900bb11d883b746428280459 Signed-off-by: Taehwan Kim --- diff --git a/libcsc/csc.c b/libcsc/csc.c index 6a0e3b0..97b7925 100644 --- a/libcsc/csc.c +++ b/libcsc/csc.c @@ -356,7 +356,7 @@ static CSC_ERRORCODE csc_init_hw( #endif default: ALOGE("%s:: unsupported csc_hw_type, csc use sw", __func__); - csc_handle->csc_hw_handle == NULL; + csc_handle->csc_hw_handle = NULL; break; } } @@ -476,6 +476,9 @@ CSC_ERRORCODE csc_deinit( CSC_ERRORCODE ret = CSC_ErrorNone; CSC_HANDLE *csc_handle; + if (handle == NULL) + return ret; + csc_handle = (CSC_HANDLE *)handle; if (csc_handle->csc_method == CSC_METHOD_HW) { switch (csc_handle->csc_hw_type) { @@ -495,10 +498,8 @@ CSC_ERRORCODE csc_deinit( } } - if (csc_handle != NULL) { - free(csc_handle); - ret = CSC_ErrorNone; - } + free(csc_handle); + ret = CSC_ErrorNone; return ret; }