mirror of
https://gitee.com/open-loongarch/linux-6.12.git
synced 2026-10-28 05:57:12 +08:00
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: d0f8e961deae ("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>
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
committed by
maoxiaochuan
parent
8cd65cccd2
commit
63e2285289
@@ -485,7 +485,8 @@ close_transfer:
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user