Re: [PATCH 2/2] ASoC: spacemit: init *dp to NULL before error paths
From: Bui Duc Phuc
Date: Mon Aug 03 2026 - 23:38:26 EST
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