Re: [PATCH] ASoC: rockchip: i2s: Fix NULL pointer dereference when pinctrl is not found

From: Mark Brown
Date: Mon Jul 11 2022 - 09:24:19 EST


On Mon, Jul 11, 2022 at 02:05:22PM +0100, Alexandru Elisei wrote:
> Commit a5450aba737d ("ASoC: rockchip: i2s: switch BCLK to GPIO") switched
> BCLK to GPIO functions when probing the i2s bus interface, but missed
> adding a check for when devm_pinctrl_get() returns an error. This can lead
> to the following NULL pointer dereference on a rockpro64-v2 if there are no
> "pinctrl" properties in the i2s device tree node:
>
> [ 0.658381] rockchip-i2s ff880000.i2s: failed to find i2s default state
> [ 0.658993] rockchip-i2s ff880000.i2s: failed to find i2s gpio state
> [ 0.660072] rockchip-i2s ff890000.i2s: failed to find i2s default state
> [ 0.660670] rockchip-i2s ff890000.i2s: failed to find i2s gpio state

Please think hard before including complete backtraces in upstream
reports, they are very large and contain almost no useful information
relative to their size so often obscure the relevant content in your
message. If part of the backtrace is usefully illustrative (it often is
for search engines if nothing else) then it's usually better to pull out
the relevant sections.

Attachment: signature.asc
Description: PGP signature