Re: [PATCH 05/10] of: Fix available buffer size calculating error in API of_device_uevent_modalias()
From: Zijun Hu
Date: Wed Dec 11 2024 - 06:44:25 EST
On 2024/12/10 22:10, Rob Herring wrote:
> Ah, right. However, we still end up with a truncated value though it
> is nul terminated.
>
>> 2) both env->buflen and env->envp_idx are not updated once @env->buf
>> does not enough spaces then failed.
>>
>> current logic has no difference with normal add_uevent_var() usage.
> There is one major difference. add_uevent_var() will not output
> anything if the whole string doesn't fit. Whereas we might output a
> truncated value because the add_uevent_var() call updated env->buflen
> and env->envp_idx. We could unwind that I suppose, but that involves
> even more mucking with the internals of the env struct.
you are right.
i would like to try to solve involved issue in next revision. (^^)