Skip to content

Commit 25a3691

Browse files
sperezglzUlf Hansson
authored andcommitted
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: d0f8e96 ("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>
1 parent c2ac67b commit 25a3691

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/mmc/host/loongson2-mmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,8 @@ static irqreturn_t loongson2_mmc_irq(int irq, void *devid)
485485

486486
static void loongson2_mmc_dll_mode_init(struct loongson2_mmc_host *host)
487487
{
488-
u32 val, pad_delay, delay, ret;
488+
u32 val, pad_delay, delay;
489+
int ret;
489490

490491
regmap_update_bits(host->regmap, LOONGSON2_MMC_REG_SEL,
491492
LOONGSON2_MMC_SEL_DATA, LOONGSON2_MMC_SEL_DATA);

0 commit comments

Comments
 (0)