Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2553872imc; Sat, 23 Feb 2019 06:01:56 -0800 (PST) X-Google-Smtp-Source: AHgI3IbffNA04nKNOPteeoOKfG4+Y5ZKEotSMby10bxsurT9IeBCav9tj61a+JeJFKqgYFobsSGu X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr9582378plo.316.1550930516120; Sat, 23 Feb 2019 06:01:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550930516; cv=none; d=google.com; s=arc-20160816; b=niKWAaAtb7ZbUHe5J2kfceX49RQvy+4FQVcPFayQat0IYZo/Kz4n+G0WBceXelK2Gt fO+QV+X6UAo6sms877cIiz0/qSE0+joEIhdrexQ5aMycOi8cw4hcdmHmMrxf1C4QzOrw Mjlojbv6uceWteDCacsck+64Z5DBrMn5ZlyX2lt5AqnfxTORM4khzbPf/awF4i4HpXUQ Rulu/mvzluLQclY7H4G89WDaqWrnTxLT2DnSiNILahmF99Bd+7PxkacK7lZGJK7WM1gY 4NwIq7lQWRnix3auC0igNG5pcuF+TwKnu3NeGxv6y+iMIxtCbqveMu3i5umxKWeqem7F d2WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=r5mKeGNn8mI/kLkyWxmOVAnTApfTeZ3qq8aHvPcZ1jw=; b=Ge0OqsbKXE8Kf+jKE5+1pmzvqnudzouWvUJigh9Cl8dq6UrJHrGMf4d5qz8kFWLq9W h+5k/aKniFBAcyrSDlq2c/Mxxk+pj/8jWSfPk4OvcT/AvdtvTz3Jcs8RSwbpsc6htjw5 aXcy8YMNXlchZUVA+1LVia5YhdF1fP3DwtX+AoV/lH/vNVb6EpAkyj691aevwaOfjC6W 2ukBxvRMzIKAObJptfjmTbnOv7mK+TzQlHWbaagYYQ3uf5mpfeZeS3UhOVYXnt/TXMFg mjTdm44OMKVw9UvW5uCPQr0Ca5FdMf+w7UDDJJIOAZ7W9t+t8PQ3vsG92DZ670ZeH0/0 HhqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si3905063plt.28.2019.02.23.06.01.40; Sat, 23 Feb 2019 06:01:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728152AbfBWN7i (ORCPT + 99 others); Sat, 23 Feb 2019 08:59:38 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:17528 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727894AbfBWN6t (ORCPT ); Sat, 23 Feb 2019 08:58:49 -0500 X-IronPort-AV: E=Sophos;i="5.58,403,1544482800"; d="scan'208";a="370609503" Received: from palace.lip6.fr ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256; 23 Feb 2019 14:58:44 +0100 From: Julia Lawall To: Kishon Vijay Abraham I Cc: kernel-janitors@vger.kernel.org, Thierry Reding , Jonathan Hunter , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: [PATCH 04/12] phy: tegra: add missing of_node_put after of_device_is_available Date: Sat, 23 Feb 2019 14:20:35 +0100 Message-Id: <1550928043-14889-5-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add an of_node_put when a tested device node is not available. The semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ identifier f; local idexpression e; expression x; @@ e = f(...); ... when != of_node_put(e) when != x = e when != e = x when any if (<+...of_device_is_available(e)...+>) { ... when != of_node_put(e) ( return e; | + of_node_put(e); return ...; ) } // Fixes: 53d2a715c2403 ("phy: Add Tegra XUSB pad controller support") Signed-off-by: Julia Lawall --- drivers/phy/tegra/xusb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -u -p a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -260,8 +260,10 @@ tegra_xusb_pad_create(struct tegra_xusb_ int err; np = tegra_xusb_find_pad_node(padctl, soc->name); - if (!np || !of_device_is_available(np)) + if (!np || !of_device_is_available(np)) { + of_node_put(np); return NULL; + } pad = soc->ops->probe(padctl, soc, np); if (IS_ERR(pad)) {