Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp250930yba; Mon, 1 Apr 2019 05:51:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbKddpla7n6y6+iGcxCuT9OgjA0tj7jhGQPl0af2VwRButikcyYNJb+w6YtQs0jhIZZ9gi X-Received: by 2002:a17:902:1e6:: with SMTP id b93mr63776247plb.325.1554123099384; Mon, 01 Apr 2019 05:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554123099; cv=none; d=google.com; s=arc-20160816; b=taAaQWrdrIAY0GDuRAuH+oOV8P42laXCqAwwNS5tjuubxxW9T9doinR4yIiKpHUCGI 74V6gg8zynR3XRY7aToE/uAcv0dAx1AmFwWwCLJBlSsRaQwMBaSZvPTkUFob6nSGOj4O dxTstcSytVHtYPKT03CHdGIEbNG+i1pN0aULP0g9offmKr/d6h0AkiHMzO60E57/xeIH dGL8JBI8QLe6VScQJDpIp2gh8N+/8HBmBRttMwnfADIwMS4tbBb7I555/yE5V8GsW1DU DzOb5zIKjBYNMpExef/zOm7z4NMSm+M867icxy4h4S4JulHDGvFOoQiAeuInbl1RFkaN /tYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=fnOPzpgvM8BJwZzvaXkvFYjftDevhMxtbfMAt0jXd2U=; b=JLiV03HeWW8jD5yh7rRxCiHhcyjT0dah08XvqpGTRBuXfr7gDNnmPrrtd8E5CCp2Vh oUI7a71Qb4VKTvscnHZ3pSDExIr3fr4HVN5TxjalSncgs35U8hpoffjCFnA7DljsQVJK IWaRP+zvL+Uuib1f8EHS+4fx05L+LUYqwMQBH5a/XN97PnrtmrTuT/GjIg49k1IYgT1C FSPxFOtTVb8Zzw9pQ3L1/yPIP1GJc+LMHuAGR1DvuHk/3tWgfm+3gbXSCWs6O3Xp43Oa Bcbh5mXF8nKaHczBoHQ5Vx66Cgcvc+qoQPUhvywMpTiYMoX5Jw/yuPjqwOk+w+yPXFVw 85jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=e4y5sEcp; dkim=pass header.i=@codeaurora.org header.s=default header.b=Zqd+e1Yg; 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 v145si8760817pgb.16.2019.04.01.05.51.23; Mon, 01 Apr 2019 05:51:39 -0700 (PDT) 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; dkim=pass header.i=@codeaurora.org header.s=default header.b=e4y5sEcp; dkim=pass header.i=@codeaurora.org header.s=default header.b=Zqd+e1Yg; 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 S1727014AbfDAMue (ORCPT + 99 others); Mon, 1 Apr 2019 08:50:34 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44560 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfDAMud (ORCPT ); Mon, 1 Apr 2019 08:50:33 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 49A1D604BE; Mon, 1 Apr 2019 12:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554123031; bh=LnvAho8D76g0pkPeMNQFqSCLmkeRDkLzdfTzt87vcvo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=e4y5sEcpf6Wb79zsRAfYmg4zo649JsTXRL+6YegfhZadjf0VeFLatt3IpY7XWt6n/ VAlUexwfbbcZybMiHEE6LL4EwwnhsxrAu6agZBGRs4XKIbd7ym4VKJznRh/q880+fk S8k3Fn7tGGHmlzw9kx6ZDdS5I2+GlcyAA+xCsaQU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.204.79.83] (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mojha@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 63FD4604BE; Mon, 1 Apr 2019 12:50:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554123028; bh=LnvAho8D76g0pkPeMNQFqSCLmkeRDkLzdfTzt87vcvo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Zqd+e1YgJENw1WayBd2fLD5zvlfVLRTiCbKsTsc472z6J0B1DGxcnPn9hc0DXSoTf tQ4cAyxmpwo3WcV5w3z8L1GDR5r+1ySVErd7JTWmQ/V9vEYWwWhKN9M966pKJ7DNYj zUXyedoXOHV6Lcu4bD3+IiqoCDluYv+1BfqPkZ40= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 63FD4604BE Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=mojha@codeaurora.org Subject: Re: [PATCH 04/12] phy: tegra: add missing of_node_put after of_device_is_available To: Julia Lawall , Kishon Vijay Abraham I Cc: kernel-janitors@vger.kernel.org, Thierry Reding , Jonathan Hunter , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> <1550928043-14889-5-git-send-email-Julia.Lawall@lip6.fr> From: Mukesh Ojha Message-ID: Date: Mon, 1 Apr 2019 18:20:22 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <1550928043-14889-5-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/23/2019 6:50 PM, Julia Lawall wrote: > 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 Reviewed-by: Mukesh Ojha Cheers, -Mukesh > > --- > 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)) { >