mmc: loongson2: prevent integer overflow in ret variable

In loongson2_mmc_dll_mode_init(), `ret` variable is declared
as u32 but it is expected to hold an int value.

Fixes: d0f8e961de ("mmc: loongson2: Add Loongson-2K2000 SD/SDIO/eMMC controller driver")
Reported-by: https://scan7.scan.coverity.com/#/project-view/53936/11354?selectedIssue=1644958
Signed-off-by: Sergio Perez Gonzalez <sperezglz@gmail.com>
Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/20250707185545.46275-1-sperezglz@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Sergio Perez Gonzalez 2025-07-07 12:55:41 -06:00 committed by Ulf Hansson
parent c2ac67b5b1
commit 25a36912dc

View File

@ -485,7 +485,8 @@ static irqreturn_t loongson2_mmc_irq(int irq, void *devid)
static void loongson2_mmc_dll_mode_init(struct loongson2_mmc_host *host)
{
u32 val, pad_delay, delay, ret;
u32 val, pad_delay, delay;
int ret;
regmap_update_bits(host->regmap, LOONGSON2_MMC_REG_SEL,
LOONGSON2_MMC_SEL_DATA, LOONGSON2_MMC_SEL_DATA);