From 4a73740a0a424f0a250d5c4238d73de89ba16ec5 Mon Sep 17 00:00:00 2001 From: zhangyalei Date: Fri, 18 Mar 2022 00:48:20 -0700 Subject: [PATCH] codehub issues clean Signed-off-by: zhangyalei --- platform/mipi_dsi/mipi_tx_hi35xx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/platform/mipi_dsi/mipi_tx_hi35xx.c b/platform/mipi_dsi/mipi_tx_hi35xx.c index b72caf0..ce99eb4 100644 --- a/platform/mipi_dsi/mipi_tx_hi35xx.c +++ b/platform/mipi_dsi/mipi_tx_hi35xx.c @@ -37,6 +37,7 @@ extern "C" { #endif /* End of #ifdef __cplusplus */ #define HDF_LOG_TAG mipi_tx_hi35xx +#define INT_MAX_VALUE 0x7fffffff volatile MipiTxRegsTypeTag *g_mipiTxRegsVa = NULL; unsigned int g_mipiTxIrqNum = MIPI_TX_IRQ; @@ -143,6 +144,10 @@ static void MipiTxDrvGetPhyPllSet1Set5(unsigned int phyDataRate, } else { pllRef = 1; } + if ((dataRateClk * pllRef) > INT_MAX_VALUE) { + HDF_LOGE("%s: exceeds the maximum value of type int.", __func__); + return; + } if ((dataRateClk * pllRef) % 2) { /* 2: pll */ *pllSet1 = 0x10; *pllSet5 = (dataRateClk * pllRef - 1) / 2; /* 2: pllRef sel */ -- Gitee