Re: [PATCH] power: supply: qcom_battmgr: terminate the strings from firmware
Sebastian Reichel <[email protected]>
| Newsgroups | org.kernel.vger.linux-pm,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 27 Jul 2026 16:41:19 +0900, HyeongJun An wrote:
> The qcom_battmgr_sc8280xp_strcpy() takes a Pascal-style string when the
> firmware sends one. Otherwise it copies all BATTMGR_STRING_LEN bytes and
> leaves the destination without a terminator.
>
> Those destinations are model_number, serial_number and oem_info, each
> BATTMGR_STRING_LEN and declared next to each other. They go out to user
> space as val->strval, which power_supply_format_property() prints with
> "%s", so a firmware string that fills the whole field makes that read run
> into the following members.
>
> [...]
Applied, thanks!
[1/1] power: supply: qcom_battmgr: terminate the strings from firmware
commit: ab1112df8f4ffa88cb024dd370c432ced80f77d8
Best regards,
--
Sebastian Reichel <[email protected]>