[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdb0OPqNZRbJH9EtQhVCgcfGD1EuGtEPucOGhxR+tEPr8g@mail.gmail.com>
Date: Sat, 19 Feb 2022 01:51:48 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Marc Zyngier <maz@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
kernel-team@...roid.com, Thierry Reding <treding@...dia.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH] gpio: tegra186: Fix chip_data type confusion
On Fri, Feb 11, 2022 at 10:39 AM Marc Zyngier <maz@...nel.org> wrote:
> The tegra186 GPIO driver makes the assumption that the pointer
> returned by irq_data_get_irq_chip_data() is a pointer to a
> tegra_gpio structure. Unfortunately, it is actually a pointer
> to the inner gpio_chip structure, as mandated by the gpiolib
> infrastructure. Nice try.
>
> The saving grace is that the gpio_chip is the first member of
> tegra_gpio, so the bug has gone undetected since... forever.
>
> Fix it by performing a container_of() on the pointer. This results
> in no additional code, and makes it possible to understand how
> the whole thing works.
>
> Fixes: 5b2b135a87fc ("gpio: Add Tegra186 support")
> Signed-off-by: Marc Zyngier <maz@...nel.org>
> Cc: Thierry Reding <treding@...dia.com>
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Cc: Bartosz Golaszewski <bgolaszewski@...libre.com>
Patch applied for fixes.
Yours,
Linus Walleij
Powered by blists - more mailing lists