Skip to content

Commit b0ad10f

Browse files
sperezglzKexyBiscuit
authored andcommitted
UPSTREAM: 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 <[email protected]> Reviewed-by: Binbin Zhou <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ulf Hansson <[email protected]> (cherry picked from commit 25a3691) Signed-off-by: Kexy Biscuit <[email protected]>
1 parent aed2723 commit b0ad10f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)