[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zv4EwWPoSMir1C2J@x1>
Date: Wed, 2 Oct 2024 19:43:13 -0700
From: Drew Fustini <dfustini@...storrent.com>
To: Kees Bakker <kees@...erbout.nl>
Cc: Drew Fustini <drew@...7.com>, Guo Ren <guoren@...nel.org>,
Fu Wei <wefu@...hat.com>, Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Emil Renner Berthing <emil.renner.berthing@...onical.com>,
Thomas Bonnefille <thomas.bonnefille@...tlin.com>,
linux-riscv@...ts.infradead.org, linux-gpio@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/8] pinctrl: Add driver for the T-Head TH1520 SoC
On Wed, Oct 02, 2024 at 09:36:59PM +0200, Kees Bakker wrote:
> Op 30-09-2024 om 21:50 schreef Drew Fustini:
> > From: Emil Renner Berthing <emil.renner.berthing@...onical.com>
> >
> > Add pinctrl driver for the T-Head TH1520 RISC-V SoC.
> >
> > Tested-by: Thomas Bonnefille <thomas.bonnefille@...tlin.com>
> > Signed-off-by: Emil Renner Berthing <emil.renner.berthing@...onical.com>
> > [dfustini: use thead,pad-group to identify the pin controller instance]
> > Signed-off-by: Drew Fustini <dfustini@...storrent.com>
> > ---
> > MAINTAINERS | 1 +
> > drivers/pinctrl/Kconfig | 13 +
> > drivers/pinctrl/Makefile | 1 +
> > drivers/pinctrl/pinctrl-th1520.c | 907 +++++++++++++++++++++++++++++++++++++++
> > 4 files changed, 922 insertions(+)
> >
> > [...]
> > +static int th1520_pinmux_set_mux(struct pinctrl_dev *pctldev,
> > + unsigned int fsel, unsigned int gsel)
> > +{
> > + struct th1520_pinctrl *thp = pinctrl_dev_get_drvdata(pctldev);
> > + const struct function_desc *func = pinmux_generic_get_function(pctldev, fsel);
> func can be NULL after calling pinmux_generic_get_function
> Please add something to avoid NULL pointer dereferencing in the next
> statement.
> All other callers of pinmux_generic_get_function have something like this:
> if (!func)
> return -EINVAL;
Thanks for catching this. I see that another person has posted a patch
as a result so I'll respond over in that thread [1].
Drew
[1] https://lore.kernel.org/lkml/20241003023307.2138695-1-clf700383@gmail.com/
Powered by blists - more mailing lists