* [PATCH] mmc: loongson2: prevent integer overflow in ret variable
@ 2025-07-07 18:55 Sergio Perez Gonzalez
2025-07-08 1:15 ` Binbin Zhou
2025-07-09 14:02 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Sergio Perez Gonzalez @ 2025-07-07 18:55 UTC (permalink / raw)
To: zhoubinbin, ulf.hansson; +Cc: Sergio Perez Gonzalez, linux-mmc, linux-kernel
In loongson2_mmc_dll_mode_init(), `ret` variable is declared
as u32 but it is expected to hold an int value.
Fixes: d0f8e961deae ("mc: 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>
---
drivers/mmc/host/loongson2-mmc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/loongson2-mmc.c b/drivers/mmc/host/loongson2-mmc.c
index 515ccf834f0a..ba6bb8fd5535 100644
--- a/drivers/mmc/host/loongson2-mmc.c
+++ b/drivers/mmc/host/loongson2-mmc.c
@@ -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);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: loongson2: prevent integer overflow in ret variable
2025-07-07 18:55 [PATCH] mmc: loongson2: prevent integer overflow in ret variable Sergio Perez Gonzalez
@ 2025-07-08 1:15 ` Binbin Zhou
2025-07-09 14:02 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Binbin Zhou @ 2025-07-08 1:15 UTC (permalink / raw)
To: Sergio Perez Gonzalez, ulf.hansson; +Cc: linux-mmc, linux-kernel
Hi Sergio:
Thanks for your patch.
在 2025/7/8 02:55, Sergio Perez Gonzalez 写道:
> In loongson2_mmc_dll_mode_init(), `ret` variable is declared
> as u32 but it is expected to hold an int value.
>
> Fixes: d0f8e961deae ("mc: 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>
> ---
> drivers/mmc/host/loongson2-mmc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/loongson2-mmc.c b/drivers/mmc/host/loongson2-mmc.c
> index 515ccf834f0a..ba6bb8fd5535 100644
> --- a/drivers/mmc/host/loongson2-mmc.c
> +++ b/drivers/mmc/host/loongson2-mmc.c
> @@ -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);
Thanks.
Binbin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: loongson2: prevent integer overflow in ret variable
2025-07-07 18:55 [PATCH] mmc: loongson2: prevent integer overflow in ret variable Sergio Perez Gonzalez
2025-07-08 1:15 ` Binbin Zhou
@ 2025-07-09 14:02 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2025-07-09 14:02 UTC (permalink / raw)
To: Sergio Perez Gonzalez; +Cc: zhoubinbin, linux-mmc, linux-kernel
On Mon, 7 Jul 2025 at 20:56, Sergio Perez Gonzalez <sperezglz@gmail.com> wrote:
>
> In loongson2_mmc_dll_mode_init(), `ret` variable is declared
> as u32 but it is expected to hold an int value.
>
> Fixes: d0f8e961deae ("mc: 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>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/loongson2-mmc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/loongson2-mmc.c b/drivers/mmc/host/loongson2-mmc.c
> index 515ccf834f0a..ba6bb8fd5535 100644
> --- a/drivers/mmc/host/loongson2-mmc.c
> +++ b/drivers/mmc/host/loongson2-mmc.c
> @@ -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);
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-09 14:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07 18:55 [PATCH] mmc: loongson2: prevent integer overflow in ret variable Sergio Perez Gonzalez
2025-07-08 1:15 ` Binbin Zhou
2025-07-09 14:02 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).