Re: [PATCH v5 3/7] firmware: samsung: acpm: Fix dummy stubs to return ERR_PTR
From: Tudor Ambarus
Date: Fri May 29 2026 - 08:37:26 EST
On 5/29/26 3:09 PM, Krzysztof Kozlowski wrote:
> 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
I confirm that the ACPM protocol is mandatory for the clients to
work, thanks!
>> the option space without losing any build coverage.
nice, I didn't know this. I guess it's a "greedy" algorithm in
allmodconfig, if the dependency is met the dependents are enabled too.
>>
>> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Reviewed-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxx>
>>
>
> Sure, I am fine with it. I'll take your patch with a bit adjusted commit
> msg.
>
Thank you! I need to drop the devm_acpm_get_by_phandle dummy stub from:
https://lore.kernel.org/linux-samsung-soc/a59c6e3a-6092-4114-8961-c2a71a812959@xxxxxxxxxx/T/#m0ac077507129c37b84443513eecadd70b5eaf8b8
Shall I send again the entire set?
Cheers,
ta