[PATCH 2/2] ASoC: spacemit: init *dp to NULL before error paths
Bui Duc Phuc
phucduc.bui at gmail.com
Mon Aug 3 20:38:05 PDT 2026
Hi Troy,
Thank you for your feedback.
> I still do not think this initialization is necessary. Currently,
> spacemit_i2s_init_dai() has exactly one failure path: devm_kmemdup() fails
> and the function returns -ENOMEM. The sole caller checks that return value
> and exits immediately.
>
> A caller that continued after ignoring the error would itself be incorrect
> and should not be accommodated. The helper is also static and has only this
> one caller, so there is no current API contract that requires the output to
> be initialized on failure.
>
> I suggest dropping this patch.
I agree. I'll drop this patch from the series.
Best regards,
Phuc
More information about the linux-riscv
mailing list