diff mbox series

[v7,01/39] ARM: ep93xx: Add terminator to gpiod_lookup_table

Message ID 20240118-ep93xx-v7-1-d953846ae771@maquefel.me (mailing list archive)
State New, archived
Headers show
Series [v7,01/39] ARM: ep93xx: Add terminator to gpiod_lookup_table | expand

Commit Message

Nikita Shubin via B4 Relay Jan. 18, 2024, 8:20 a.m. UTC
From: Nikita Shubin <nikita.shubin@maquefel.me>

Without the terminator, if a con_id is passed to gpio_find() that
does not exist in the lookup table the function will not stop looping
correctly, and eventually cause an oops.

Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
---
 arch/arm/mach-ep93xx/core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Linus Walleij Jan. 18, 2024, 11:52 p.m. UTC | #1
On Thu, Jan 18, 2024 at 9:22 AM Nikita Shubin via B4 Relay
<devnull+nikita.shubin.maquefel.me@kernel.org> wrote:

> From: Nikita Shubin <nikita.shubin@maquefel.me>
>
> Without the terminator, if a con_id is passed to gpio_find() that
> does not exist in the lookup table the function will not stop looping
> correctly, and eventually cause an oops.
>
> Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
> Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>

Sorry, my bug...
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Andy Shevchenko Feb. 4, 2024, 4:32 p.m. UTC | #2
Thu, Jan 18, 2024 at 11:20:44AM +0300, Nikita Shubin kirjoitti:
> Without the terminator, if a con_id is passed to gpio_find() that
> does not exist in the lookup table the function will not stop looping
> correctly, and eventually cause an oops.
> 
> Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
> Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>

I prefer @linux.intel.com (sorry if I haven't used that one for the report).

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Uwe Kleine-König Feb. 5, 2024, 8:52 a.m. UTC | #3
On Thu, Jan 18, 2024 at 11:20:44AM +0300, Nikita Shubin via B4 Relay wrote:
> From: Nikita Shubin <nikita.shubin@maquefel.me>
> 
> Without the terminator, if a con_id is passed to gpio_find() that
> does not exist in the lookup table the function will not stop looping
> correctly, and eventually cause an oops.
> 
> Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
> Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>

I don't know how's the state of the series and when it's expected to go
in. Given this is a fix preventing a possible oops, I wonder if this one
should be taken already now?

Best regards
Uwe
Alexander Sverdlin Feb. 5, 2024, 9:42 a.m. UTC | #4
Hi Arnd and all,

On Fri, 2024-01-19 at 00:52 +0100, Linus Walleij wrote:
> On Thu, Jan 18, 2024 at 9:22 AM Nikita Shubin via B4 Relay
> <devnull+nikita.shubin.maquefel.me@kernel.org> wrote:
> 
> > From: Nikita Shubin <nikita.shubin@maquefel.me>
> > 
> > Without the terminator, if a con_id is passed to gpio_find() that
> > does not exist in the lookup table the function will not stop looping
> > correctly, and eventually cause an oops.
> > 
> > Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
> > Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> > Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
> 
> Sorry, my bug...
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Cc: stable@vger.kernel.org
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

Arnd, could you please take this into arm-soc?
I can send a PR, but this probably makes little sense for one patch?
Arnd Bergmann Feb. 5, 2024, 10:02 a.m. UTC | #5
On Mon, Feb 5, 2024, at 09:42, Alexander Sverdlin wrote:
> Hi Arnd and all,
>
> On Fri, 2024-01-19 at 00:52 +0100, Linus Walleij wrote:
>> On Thu, Jan 18, 2024 at 9:22 AM Nikita Shubin via B4 Relay
>> <devnull+nikita.shubin.maquefel.me@kernel.org> wrote:
>> 
>> > From: Nikita Shubin <nikita.shubin@maquefel.me>
>> > 
>> > Without the terminator, if a con_id is passed to gpio_find() that
>> > does not exist in the lookup table the function will not stop looping
>> > correctly, and eventually cause an oops.
>> > 
>> > Fixes: b2e63555592f ("i2c: gpio: Convert to use descriptors")
>> > Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
>> > Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me>
>> 
>> Sorry, my bug...
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>
> Cc: stable@vger.kernel.org
> Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
>
> Arnd, could you please take this into arm-soc?
> I can send a PR, but this probably makes little sense for one patch?

I'm travelling at the moment, but can take it when I get back.

If you want to be sure it doesn't get lost, please send the
patch (with the Acks) to soc@kernel.org and it will end up
in patchwork.

   Arnd
Alexander Sverdlin Feb. 5, 2024, 10:13 a.m. UTC | #6
Thanks Arnd,

On Mon, 2024-02-05 at 10:02 +0000, Arnd Bergmann wrote:
> I'm travelling at the moment, but can take it when I get back.
> 
> If you want to be sure it doesn't get lost, please send the
> patch (with the Acks) to soc@kernel.org and it will end up
> in patchwork.

I'll do it!
diff mbox series

Patch

diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 71b113976420..8b1ec60a9a46 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -339,6 +339,7 @@  static struct gpiod_lookup_table ep93xx_i2c_gpiod_table = {
 				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
 		GPIO_LOOKUP_IDX("G", 0, NULL, 1,
 				GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
+		{ }
 	},
 };