Re: [PATCH] power: supply: qcom_smbx: Remove const from desc allocation type
From: Sebastian Reichel
Date: Sun Oct 04 2026 - 13:50:40 EST
On Thu, 17 Sep 2026 14:13:10 -0700, Kees Cook wrote:
> In preparation for making the devm_kmalloc family of allocators type
> aware, we need to make sure that the returned type from the allocation
> matches the type of the variable being assigned. (Before, the allocator
> would always return "void *", which can be implicitly cast to any
> pointer type.)
>
> The assigned type is "struct power_supply_desc *", but the converted
> allocation type would be "const struct power_supply_desc *", as the size
> was taken from "smb_psy_desc", which is a
> "static const struct power_supply_desc". As there is no general way to
> remove const qualifiers, take the size from the assignment target
> instead. No change in allocation size results.
>
> [...]
Applied, thanks!
[1/1] power: supply: qcom_smbx: Remove const from desc allocation type
commit: 6415ce7204af0e282f32c5ca69953d4224ac49fb
Best regards,
--
Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>