From: Sunmi Lee Date: Fri, 6 Jul 2018 08:39:03 +0000 (+0900) Subject: [COMMON] fimc-is2: Fix a bug of devide by zero X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4fca98299daa6256f80f1aff275ec6a6c9ed9f9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] fimc-is2: Fix a bug of devide by zero There is a possiblity to execute of dividing by zero in CALC_LNR_INTRPL. PR JIRA ID: CPR-39 Change-Id: Idb23bc03b5622b79dadc5ebac184a7bc8e4018c6 Signed-off-by: Sunmi Lee --- diff --git a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c index 85e3a25aa602..a45c3e122d86 100644 --- a/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c +++ b/drivers/media/platform/exynos/fimc-is2/hardware/fimc-is-hw-uvsp-cac.c @@ -22,7 +22,7 @@ #define RSHFT(a) ((int)((a) >> INTRPL_SHFT_VAL)) #define NUMERATOR(Y1, Y2, DXn) (((Y2) - (Y1)) * (DXn)) #define CALC_LNR_INTRPL(Y1, Y2, X1, X2, X) (LSHFT(NUMERATOR(Y1, Y2, SUB(X, X1))) / SUB(X2, X1) + LSHFT(Y1)) -#define GET_LNR_INTRPL(Y1, Y2, X1, X2, X) RSHFT(CALC_LNR_INTRPL(Y1, Y2, X1, X2, X)) +#define GET_LNR_INTRPL(Y1, Y2, X1, X2, X) RSHFT(SUB(X2, X1) ? CALC_LNR_INTRPL(Y1, Y2, X1, X2, X) : LSHFT(Y1)) struct ref_ni { u32 min;