[lkml]   [2018]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] leds: tlc591xx: fix device_node_continue.cocci warnings (fwd)

The code seems to be wrong in several ways. If the continue is wanted,
the of_node_put is not needed; it will happen on the next iteration. If
the continue is not wanted, the of_node_put is needed, and the continue
should be dropped.


---------- Forwarded message ----------
Date: Thu, 6 Dec 2018 19:48:54 +0800
From: kbuild test robot <>
Cc: Julia Lawall <>
Subject: [PATCH] leds: tlc591xx: fix device_node_continue.cocci warnings

TO: Jyri Sarha <>
CC: Peter Ujfalusi <>
CC: Jacek Anaszewski <>
CC: Pavel Machek <>

From: kbuild test robot <>

drivers/leds/leds-tlc591xx.c:342:3-14: ERROR: probable double put.

Device node iterators put the previous value of the index variable, so an
explicit put causes a double put.

Generated by: scripts/coccinelle/iterators/device_node_continue.cocci

Fixes: 7b2d34aaede7 ("leds: tlc591xx: Add gpio output support")
CC: Jyri Sarha <>
Signed-off-by: kbuild test robot <>

tree: peter/ti-linux-4.19.y/wip
head: 838f24e2deaf1229002bd6555eb7e889b09ac1f9
commit: 7b2d34aaede727b4abfc78061bbd2202fcd92bc8 [62/67] leds: tlc591xx: Add gpio output support
:::::: branch date: 26 hours ago
:::::: commit date: 26 hours ago

Please take the patch only if it's a positive warning. Thanks!

leds-tlc591xx.c | 1 -
1 file changed, 1 deletion(-)

--- a/drivers/leds/leds-tlc591xx.c
+++ b/drivers/leds/leds-tlc591xx.c
@@ -339,7 +339,6 @@ tlc591xx_probe(struct i2c_client *client
for_each_child_of_node(np, child) {
err = of_property_read_u32(child, "reg", &reg);
if (err) {
- of_node_put(child);
return err;
 \ /
  Last update: 2018-12-06 21:29    [W:0.044 / U:3.596 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site