[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdZShkMhO9vTvdbyEzkGLL2+mfnLmADGukNZ-Xw=NNxksQ@mail.gmail.com>
Date: Thu, 27 Feb 2025 21:23:47 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Wentao Liang <vulab@...as.ac.cn>
Cc: linux-arm-kernel@...ts.infradead.org, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] pinctrl: nomadik: Add error handling for find_nmk_gpio_from_pin
Hi Wentao,
thanks for your patch!
On Thu, Feb 20, 2025 at 9:51 AM Wentao Liang <vulab@...as.ac.cn> wrote:
> When find_nmk_gpio_from_pin fails to find a valid GPIO chip
> for the given pin, the bit variable remains uninitialized. This
> uninitialized value is then passed to __nmk_gpio_set_mode,
> leading to undefined behavior and undesired address access.
>
> To fix this, add error handling to check the return value of
> find_nmk_gpio_from_pin. Log an error message indicating an
> invalid pin offset and return -EINVAL immediately If the function
> fails.
>
> Fixes: 75d270fda64d ("gpio: nomadik: request dynamic ID allocation")
> Cc: stable@...r.kernel.org # 6.9+
Unnecessary to tag for stable. It is not causing regressions.
Skip this and apply for nonurgent fixes.
> Signed-off-by: Wentao Liang <vulab@...as.ac.cn>
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Yours,
Linus Walleij
Powered by blists - more mailing lists