* [PATCH linux-next] leds: netxbig: drop the second allocation of the leds array
@ 2026-12-01 15:56 Sasha Levin
2026-12-01 15:59 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2026-12-01 15:56 UTC (permalink / raw)
To: Mark Brown
Cc: Lee Jones, Pavel Machek, Kees Cook, Wentao Liang, linux-leds,
Linux Next Mailing List, Linux Kernel Mailing List
Since next-20261120 the merge of the leds-lj tree with the origin tree
allocates the leds array in netxbig_leds_get_of_pdata() twice:
leds = devm_kzalloc_objs(dev, *leds, num_leds);
leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL);
if (!leds)
return -ENOMEM;
The first line is the origin side, from commit 4dd10fbbeb9c ("treewide:
Convert devm_kmalloc() family to the devm_kmalloc_obj() family"). The
second is the leds-lj side: commit 41ea2c75f886 ("leds: netxbig: Fix
platform device reference leak on successful probe") only changed the
error path below it. The first array is never used and stays allocated
until the device is unbound.
Keep the devm_kzalloc_objs() call and drop the devm_kcalloc() one, as
the merge does for the other allocations in this function.
Fixes: 7fa58f4b0c86 ("Merge branch 'for-leds-next' of https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git")
Link: https://lore.kernel.org/all/c05653b5-c8bd-46ca-aaf5-281e8d74f1e6@sirena.org.uk/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
For folding into the leds-lj merge. Applies to next-20261130, built
drivers/leds/leds-netxbig.o on x86_64 allmodconfig (clang 21, W=1).
drivers/leds/leds-netxbig.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index 29ddebebfa37d..284f3bfad9cbe 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -510,7 +510,6 @@ static int netxbig_leds_get_of_pdata(struct device *dev,
}
leds = devm_kzalloc_objs(dev, *leds, num_leds);
- leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL);
if (!leds)
return -ENOMEM;
base-commit: 253f86660c1f882fbf554db5eaa34bc5d66dc7e8
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-01 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 15:56 [PATCH linux-next] leds: netxbig: drop the second allocation of the leds array Sasha Levin
2026-12-01 15:59 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox