* linux-next: manual merge of the leds-lj tree with the origin tree
@ 2026-11-27 15:01 Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-11-27 15:01 UTC (permalink / raw)
To: Lee Jones
Cc: Kees Cook, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List, Yige Jiang
[-- Attachment #1: Type: text/plain, Size: 1755 bytes --]
Hi all,
Today's linux-next merge of the leds-lj tree got a conflict in:
drivers/leds/rgb/leds-pwm-multicolor.c
between commit:
4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")
from the origin tree and commit:
68c7c6f993cb3 ("leds: pwm-multicolor: Manage the multi-led node reference")
from the leds-lj tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/leds/rgb/leds-pwm-multicolor.c
index c8395fdbcbdbc,10527a64d1982..0000000000000
--- a/drivers/leds/rgb/leds-pwm-multicolor.c
+++ b/drivers/leds/rgb/leds-pwm-multicolor.c
@@@ -124,18 -133,15 +133,14 @@@ static int led_pwm_mc_probe(struct plat
/* count the nodes inside the multi-led node */
count = fwnode_get_child_node_count(mcnode);
- priv = devm_kzalloc(&pdev->dev, struct_size(priv, leds, count),
- GFP_KERNEL);
+ priv = devm_kzalloc_flex(&pdev->dev, *priv, leds, count);
- if (!priv) {
- ret = -ENOMEM;
- goto release_mcnode;
- }
+ if (!priv)
+ return -ENOMEM;
mutex_init(&priv->lock);
- subled = devm_kcalloc(&pdev->dev, count, sizeof(*subled), GFP_KERNEL);
+ subled = devm_kzalloc_objs(&pdev->dev, *subled, count);
- if (!subled) {
- ret = -ENOMEM;
- goto release_mcnode;
- }
+ if (!subled)
+ return -ENOMEM;
priv->mc_cdev.subled_info = subled;
/* init the multicolor's LED class device */
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* linux-next: manual merge of the leds-lj tree with the origin tree
@ 2026-11-27 15:01 Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-11-27 15:01 UTC (permalink / raw)
To: Lee Jones
Cc: Joseph Telaak, Kees Cook, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]
Hi all,
Today's linux-next merge of the leds-lj tree got a conflict in:
drivers/leds/rgb/leds-ktd202x.c
between commit:
4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")
from the origin tree and commit:
84c670760a749 ("leds: rgb: ktd202x: Add Etek ET6326 support")
from the leds-lj tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/leds/rgb/leds-ktd202x.c
index f1822281c3e61,2e84fed016f9f..0000000000000
--- a/drivers/leds/rgb/leds-ktd202x.c
+++ b/drivers/leds/rgb/leds-ktd202x.c
@@@ -540,7 -903,12 +903,12 @@@ static int ktd202x_probe(struct i2c_cli
if (!count || count > KTD202X_MAX_LEDS)
return dev_err_probe(dev, -EINVAL, "Incorrect number of leds (%d)", count);
- chip = devm_kzalloc_flex(dev, *chip, leds, count);
+ caps = i2c_get_match_data(client);
+ if (!caps)
+ return -ENODEV;
+
+ /* Loops over the LEDs go up to the number of channels, not of child nodes */
- chip = devm_kzalloc(dev, struct_size(chip, leds, caps->num_leds), GFP_KERNEL);
++ chip = devm_kzalloc_flex(dev, *chip, leds, caps->num_leds);
if (!chip)
return -ENOMEM;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* linux-next: manual merge of the leds-lj tree with the origin tree
@ 2026-11-20 15:41 Mark Brown
2026-11-27 13:29 ` Lee Jones
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2026-11-20 15:41 UTC (permalink / raw)
To: Lee Jones
Cc: Kees Cook, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List, Wentao Liang
[-- Attachment #1: Type: text/plain, Size: 3217 bytes --]
Hi all,
Today's linux-next merge of the leds-lj tree got a conflict in:
drivers/leds/leds-netxbig.c
between commit:
4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")
from the origin tree and commit:
41ea2c75f886d ("leds: netxbig: Fix platform device reference leak on successful probe")
from the leds-lj tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/leds/leds-netxbig.c
index 6f59f91fac6c8,3a0456eae2c32..0000000000000
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@@ -461,32 -461,30 +461,29 @@@ static int netxbig_leds_get_of_pdata(st
}
gpio_ext_dev = &gpio_ext_pdev->dev;
- gpio_ext = devm_kzalloc(dev, sizeof(*gpio_ext), GFP_KERNEL);
+ gpio_ext = devm_kzalloc_obj(dev, *gpio_ext);
- if (!gpio_ext) {
- of_node_put(gpio_ext_np);
+ if (!gpio_ext)
ret = -ENOMEM;
- goto put_device;
- }
- ret = netxbig_gpio_ext_get(dev, gpio_ext_dev, gpio_ext);
+ else
+ ret = netxbig_gpio_ext_get(dev, gpio_ext_dev, gpio_ext);
+
of_node_put(gpio_ext_np);
+ put_device(gpio_ext_dev);
if (ret)
- goto put_device;
+ return ret;
+
pdata->gpio_ext = gpio_ext;
/* Timers (optional) */
ret = of_property_count_u32_elems(np, "timers");
if (ret > 0) {
- if (ret % 3) {
- ret = -EINVAL;
- goto put_device;
- }
+ if (ret % 3)
+ return -EINVAL;
num_timers = ret / 3;
- timers = devm_kcalloc(dev, num_timers, sizeof(*timers),
- GFP_KERNEL);
+ timers = devm_kzalloc_objs(dev, *timers, num_timers);
- if (!timers) {
- ret = -ENOMEM;
- goto put_device;
- }
+ if (!timers)
+ return -ENOMEM;
for (i = 0; i < num_timers; i++) {
u32 tmp;
@@@ -511,15 -507,12 +506,13 @@@
num_leds = of_get_available_child_count(np);
if (!num_leds) {
dev_err(dev, "No LED subnodes found in DT\n");
- ret = -ENODEV;
- goto put_device;
+ return -ENODEV;
}
+ leds = devm_kzalloc_objs(dev, *leds, num_leds);
- if (!leds) {
- ret = -ENOMEM;
- goto put_device;
- }
+ leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL);
+ if (!leds)
+ return -ENOMEM;
led = leds;
for_each_available_child_of_node_scoped(np, child) {
@@@ -540,14 -533,14 +533,12 @@@
ret = of_property_read_u32(child, "max-brightness",
&led->bright_max);
if (ret)
- goto put_device;
+ return ret;
mode_val =
- devm_kcalloc(dev,
- NETXBIG_LED_MODE_NUM, sizeof(*mode_val),
- GFP_KERNEL);
+ devm_kzalloc_objs(dev, *mode_val, NETXBIG_LED_MODE_NUM);
- if (!mode_val) {
- ret = -ENOMEM;
- goto put_device;
- }
+ if (!mode_val)
+ return -ENOMEM;
for (i = 0; i < NETXBIG_LED_MODE_NUM; i++)
mode_val[i] = NETXBIG_LED_INVALID_MODE;
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: linux-next: manual merge of the leds-lj tree with the origin tree
2026-11-20 15:41 Mark Brown
@ 2026-11-27 13:29 ` Lee Jones
2026-11-27 15:10 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2026-11-27 13:29 UTC (permalink / raw)
To: Mark Brown
Cc: Kees Cook, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List, Wentao Liang
On Fri, 20 Nov 2026, Mark Brown wrote:
> Hi all,
>
> Today's linux-next merge of the leds-lj tree got a conflict in:
>
> drivers/leds/leds-netxbig.c
>
> between commit:
>
> 4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")
>
> from the origin tree and commit:
>
> 41ea2c75f886d ("leds: netxbig: Fix platform device reference leak on successful probe")
>
> from the leds-lj tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc drivers/leds/leds-netxbig.c
> index 6f59f91fac6c8,3a0456eae2c32..0000000000000
> --- a/drivers/leds/leds-netxbig.c
> +++ b/drivers/leds/leds-netxbig.c
> @@@ -461,32 -461,30 +461,29 @@@ static int netxbig_leds_get_of_pdata(st
> }
> gpio_ext_dev = &gpio_ext_pdev->dev;
>
> - gpio_ext = devm_kzalloc(dev, sizeof(*gpio_ext), GFP_KERNEL);
> + gpio_ext = devm_kzalloc_obj(dev, *gpio_ext);
> - if (!gpio_ext) {
> - of_node_put(gpio_ext_np);
> + if (!gpio_ext)
> ret = -ENOMEM;
> - goto put_device;
> - }
> - ret = netxbig_gpio_ext_get(dev, gpio_ext_dev, gpio_ext);
> + else
> + ret = netxbig_gpio_ext_get(dev, gpio_ext_dev, gpio_ext);
> +
> of_node_put(gpio_ext_np);
> + put_device(gpio_ext_dev);
> if (ret)
> - goto put_device;
> + return ret;
> +
> pdata->gpio_ext = gpio_ext;
>
> /* Timers (optional) */
> ret = of_property_count_u32_elems(np, "timers");
> if (ret > 0) {
> - if (ret % 3) {
> - ret = -EINVAL;
> - goto put_device;
> - }
> + if (ret % 3)
> + return -EINVAL;
>
> num_timers = ret / 3;
> - timers = devm_kcalloc(dev, num_timers, sizeof(*timers),
> - GFP_KERNEL);
> + timers = devm_kzalloc_objs(dev, *timers, num_timers);
> - if (!timers) {
> - ret = -ENOMEM;
> - goto put_device;
> - }
> + if (!timers)
> + return -ENOMEM;
> for (i = 0; i < num_timers; i++) {
> u32 tmp;
>
> @@@ -511,15 -507,12 +506,13 @@@
> num_leds = of_get_available_child_count(np);
> if (!num_leds) {
> dev_err(dev, "No LED subnodes found in DT\n");
> - ret = -ENODEV;
> - goto put_device;
> + return -ENODEV;
> }
>
> + leds = devm_kzalloc_objs(dev, *leds, num_leds);
> - if (!leds) {
> - ret = -ENOMEM;
> - goto put_device;
> - }
> + leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL);
Doesn't this now reallocate leds?
> + if (!leds)
> + return -ENOMEM;
>
> led = leds;
> for_each_available_child_of_node_scoped(np, child) {
> @@@ -540,14 -533,14 +533,12 @@@
> ret = of_property_read_u32(child, "max-brightness",
> &led->bright_max);
> if (ret)
> - goto put_device;
> + return ret;
>
> mode_val =
> - devm_kcalloc(dev,
> - NETXBIG_LED_MODE_NUM, sizeof(*mode_val),
> - GFP_KERNEL);
> + devm_kzalloc_objs(dev, *mode_val, NETXBIG_LED_MODE_NUM);
> - if (!mode_val) {
> - ret = -ENOMEM;
> - goto put_device;
> - }
> + if (!mode_val)
> + return -ENOMEM;
>
> for (i = 0; i < NETXBIG_LED_MODE_NUM; i++)
> mode_val[i] = NETXBIG_LED_INVALID_MODE;
--
Lee Jones
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: linux-next: manual merge of the leds-lj tree with the origin tree
2026-11-27 13:29 ` Lee Jones
@ 2026-11-27 15:10 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2026-11-27 15:10 UTC (permalink / raw)
To: Lee Jones
Cc: Kees Cook, Kees Cook, Linux Kernel Mailing List,
Linux Next Mailing List, Wentao Liang
[-- Attachment #1: Type: text/plain, Size: 490 bytes --]
On Fri, Nov 27, 2026 at 01:29:46PM +0000, Lee Jones wrote:
> On Fri, 20 Nov 2026, Mark Brown wrote:
> > + leds = devm_kzalloc_objs(dev, *leds, num_leds);
> > - if (!leds) {
> > - ret = -ENOMEM;
> > - goto put_device;
> > - }
> > + leds = devm_kcalloc(dev, num_leds, sizeof(*leds), GFP_KERNEL);
> Doesn't this now reallocate leds?
Looks like it. It'll go away if you merge up Linus' tree and stop
getting these noisy commits, or if you send me a patch I can apply it as
a fixup.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-11-27 15:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-27 15:01 linux-next: manual merge of the leds-lj tree with the origin tree Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2026-11-27 15:01 Mark Brown
2026-11-20 15:41 Mark Brown
2026-11-27 13:29 ` Lee Jones
2026-11-27 15:10 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®