Re: [PATCH] power: supply: qcom_battmgr: fix battery chemistry strncmp length

From: Sebastian Reichel

Date: Wed Aug 12 2026 - 18:24:52 EST



On Wed, 12 Aug 2026 00:44:47 -0700, Tingguo Cheng wrote:
> The battery_chemistry field is a 4-byte array without guaranteed null
> termination. Using BATTMGR_CHEMISTRY_LEN (4) as the strncmp length for
> 3-character string literals implicitly requires chemistry[3] == '\0',
> which may not hold. Use 3 instead to match only the significant bytes.

Applied, thanks!

[1/1] power: supply: qcom_battmgr: fix battery chemistry strncmp length
commit: 37689bcbc41b3850781b6c84f90cb4bd632bfbf0

Best regards,
--
Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>