Re: [PATCH v5 3/7] firmware: samsung: acpm: Fix dummy stubs to return ERR_PTR

From: Krzysztof Kozlowski

Date: Fri May 29 2026 - 08:14:15 EST


On 29/05/2026 13:51, Arnd Bergmann wrote:
> On Tue, May 5, 2026, at 15:13, Tudor Ambarus wrote:
>> Sashiko identified a potential NULL pointer dereference [1].
>>
>> The dummy stub implementation for devm_acpm_get_by_node() returns NULL
>> when CONFIG_EXYNOS_ACPM_PROTOCOL is disabled.
>
> I meant to comment on this yesterday as well.
>
> Having stub functions like this return NULL is a common way to
> define optional interfaces, where callers still work when the
> feature is disabled, though this clearly does not work for
> acpm because some callers have a NULL pointer dereference
> when compile testing.
>
> My preferred solution to this type of problem would be to
> just remove the stub helpers and drop the ||COMPILE_TEST
> from the one user that calls them, see below.
>
> The point here is that CONFIG_EXYNOS_ACPM_PROTOCOL already
> supports compile-testing itself, and all (both) drivers using
> it clearly require the support, so this just simplifies
> the option space without losing any build coverage.
>
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
>

Sure, I am fine with it. I'll take your patch with a bit adjusted commit
msg.

Best regards,
Krzysztof