From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 573D5C04EB8 for ; Thu, 6 Dec 2018 20:28:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1DB6520868 for ; Thu, 6 Dec 2018 20:28:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DB6520868 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lip6.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726020AbeLFU2T (ORCPT ); Thu, 6 Dec 2018 15:28:19 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:22218 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725927AbeLFU2T (ORCPT ); Thu, 6 Dec 2018 15:28:19 -0500 X-IronPort-AV: E=Sophos;i="5.56,323,1539640800"; d="scan'208";a="288191903" Received: from abo-91-111-68.mrs.modulonet.fr (HELO hadrien) ([85.68.111.91]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2018 21:28:16 +0100 Date: Thu, 6 Dec 2018 21:28:16 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Jyri Sarha cc: Peter Ujfalusi , Jacek Anaszewski , Pavel Machek , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, kbuild-all@01.org Subject: [PATCH] leds: tlc591xx: fix device_node_continue.cocci warnings (fwd) Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, 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. julia ---------- Forwarded message ---------- Date: Thu, 6 Dec 2018 19:48:54 +0800 From: kbuild test robot To: kbuild@01.org Cc: Julia Lawall Subject: [PATCH] leds: tlc591xx: fix device_node_continue.cocci warnings CC: kbuild-all@01.org TO: Jyri Sarha CC: Peter Ujfalusi CC: Jacek Anaszewski CC: Pavel Machek CC: linux-leds@vger.kernel.org CC: linux-kernel@vger.kernel.org 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: https://github.com/omap-audio/linux-audio 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", ®); if (err) { - of_node_put(child); continue; return err; }