From patchwork Fri May 12 14:54:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 761687 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wPY0k0mWCz9ryk for ; Sat, 13 May 2017 00:54:46 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932661AbdELOyc (ORCPT ); Fri, 12 May 2017 10:54:32 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:33339 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932315AbdELOyb (ORCPT ); Fri, 12 May 2017 10:54:31 -0400 X-IronPort-AV: E=Sophos;i="5.38,330,1491256800"; d="scan'208";a="223437974" Received: from unknown (HELO hadrien.local) ([61.8.221.8]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 May 2017 16:54:27 +0200 Date: Fri, 12 May 2017 22:54:23 +0800 (SGT) From: Julia Lawall X-X-Sender: jll@hadrien To: netdev@vger.kernel.org, Jon Mason cc: Andrew Lunn , Florian Fainelli , kbuild-all@01.org, linux-kernel@vger.kernel.org Subject: [PATCH] mdio: mux: fix device_node_continue.cocci warnings Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Device node iterators put the previous value of the index variable, so an explicit put causes a double put. In particular, of_mdiobus_register can fail before doing anything interesting, so one could view it as a no-op from the reference count point of view. Generated by: scripts/coccinelle/iterators/device_node_continue.cocci CC: Jon Mason Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 8785ded64cfb68b8d8b2583c7c1fc611f99eabf2 commit: b60161668199ac62011c024adc9e66713b9554e7 [13999/14120] mdio: mux: mdio-mux.c | 1 - 1 file changed, 1 deletion(-) --- a/drivers/net/phy/mdio-mux.c +++ b/drivers/net/phy/mdio-mux.c @@ -169,7 +169,6 @@ int mdio_mux_init(struct device *dev, if (r) { mdiobus_free(cb->mii_bus); devm_kfree(dev, cb); - of_node_put(child_bus_node); } else { cb->next = pb->children; pb->children = cb;