[PATCH] pinctrl: rockchip: fix NULL ptr deref in rockchip_pinctrl_parse_groups()
Sergey Shtylyov
s.shtylyov at omp.ru
Thu Oct 16 02:29:05 PDT 2025
On 9/8/25 3:59 PM, Linus Walleij wrote:
[...]
>> In the Rockchip driver, rockchip_pinctrl_parse_groups() assumes that the
>> "rockchip,pins" property will always be present in the DT node it parses
>> and so doesn't check the result of of_get_property() for NULL. If the DT
>> passed to the kernel happens to have such property missing, then we will
>> get a kernel oops when the pointer is dereferenced in the *for* loop just
>> a few lines after the call. I think it's better to play safe by checking
>> the list variable for NULL (and reporting error if so), like we check the
>> size variable for validity further down...
>>
>> Found by Linux Verification Center (linuxtesting.org) with the Svace static
>> analysis tool.
>>
>> Fixes: d3e5116119bd ("pinctrl: add pinctrl driver for Rockchip SoCs")
>> Signed-off-by: Sergey Shtylyov <s.shtylyov at omp.ru>
>
> Patch applied!
Where? I'm not seeing it in any Linus' tree... :-/
> Yours,
> Linus Walleij
MBR, Sergey
More information about the Linux-rockchip
mailing list