Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp249526yba; Mon, 1 Apr 2019 05:49:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDCQE1Qs6cjDOuNTAe7SkRGa7MlrgqmBEcNrXiy+kLuhHAU+qgg6cU1g0tlHRRZ+12YPri X-Received: by 2002:a65:5a81:: with SMTP id c1mr59611935pgt.391.1554122979283; Mon, 01 Apr 2019 05:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554122979; cv=none; d=google.com; s=arc-20160816; b=hQSp58wuvnayH7DcmtchqOt0dJbUJyBWz+3+0daI8oxdmyzxg6i3fphlxvGMiqwrFq zyDA2asdkExD59EiZ81eP8RrhlAcDtQsne4I4tC4CUqdBMNKR5W1SWa2P7A50Nt1M9N/ wNLsYQDlp6VrKKF3bR4tppga+yn3eLut6ktRAcD7bFszHZepNTVzYeF2veeeJrnXw3G3 9qXCr3Mm0pyFwJCvg89QJcXoS54DUdpn7jdKSS4xvzbTrYEinDN3DSZcs9m/Io98UmsZ 0uhwR1rssA5DEFtfBGBWciSkHeFdCGwBmbG/uFiKWSkm9LB5vSiI5tpw1D1U9oCDmsxF qUJw== 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=BV6KrOxtbg4qYbNJHLylOiEsE7SOd5xjpsPw7JZtx2o=; b=grnVkCG5JOLsAYFSC9jE7NS/2LKdhhoDzDy7TnQM83QrqPo6lqJD3f+VvR8gQ7msOz MIut2AVDgeNOTN3XlwuRJhYCKLe6RGI4gnJTnWKQHD/4Z92uFSNNcggcKvsMi7LrEYVl pLLt7Mu0eNiXO0R8FuqEyHES+vzRB0+g6cRy/o0CtdsDQaBTHit56dKrXDL8zWDaULRH oaXijIO9SvW6e0QtLGoxjtTMp0JwDgmTP20+6dBMQ9Aey9el0fiu1txHbz7vM4+uoJTz 1dgBF+gdejbIr6E1yr4gecwdEIkq6VOCsKJLTibmKc9P1pTFU5q85d2HlY9EL+3+gp/K KtFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="YEhGFQ/3"; dkim=pass header.i=@codeaurora.org header.s=default header.b=anz3SQkf; 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 m72si9019600pfj.279.2019.04.01.05.49.23; Mon, 01 Apr 2019 05:49: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="YEhGFQ/3"; dkim=pass header.i=@codeaurora.org header.s=default header.b=anz3SQkf; 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 S1726841AbfDAMso (ORCPT + 99 others); Mon, 1 Apr 2019 08:48:44 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41534 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfDAMso (ORCPT ); Mon, 1 Apr 2019 08:48:44 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8A8EB607C3; Mon, 1 Apr 2019 12:48:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122923; bh=Jtw4TZiLvR7Dkhwk9uCAI8XWMIxxfoEZoMXR0/MRUog=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=YEhGFQ/3Kz45F7p2x63YldTZXI5BDqlCtLq2xzMcFUruFVwFnfnZrQ6GZaU0+9IIe 6rig5vZAcjCsxidbpHM4bmYr6xoxdnePs5h6Vuyo21DyZ5y4qWHcYP1UTCDEWaffD2 CQggibhP9TMbhmo33Wgqgaamp6FgBsQP3SlIPuIg= 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 369CF6049C; Mon, 1 Apr 2019 12:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122921; bh=Jtw4TZiLvR7Dkhwk9uCAI8XWMIxxfoEZoMXR0/MRUog=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=anz3SQkfQ4ECvZxF8tBufFVKgmODggQ2E6prKW6676Xo6lUjT4yKWrDrqn9MUwjSC LVSy4vjgZlqtyM/xjafm/FYTw0ya19KGTYDauoJg49HQPrT8yoo6CXBCVn3WruqPZo glZ9NqKYfJx84eM/DphDDEQze2PMfwIF524GvyCQ= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 369CF6049C 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 01/12] arm-cci: add missing of_node_put after of_device_is_available To: Julia Lawall , linux-kernel@vger.kernel.org, linux@arm.linux.org.uk, robin.murphy@arm.com Cc: kernel-janitors@vger.kernel.org References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> <1550928043-14889-2-git-send-email-Julia.Lawall@lip6.fr> From: Mukesh Ojha Message-ID: <2be57c65-f94c-0a64-8fa6-385f60833bb6@codeaurora.org> Date: Mon, 1 Apr 2019 18:18:35 +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-2-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: 896ddd600ba4 ("drivers: bus: check cci device tree node status") > Signed-off-by: Julia Lawall Reviewed-by: Mukesh Ojha Cheers, -Mukesh > > --- > This file doesn't seem to have a maintainer. > > drivers/bus/arm-cci.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff -u -p a/drivers/bus/arm-cci.c b/drivers/bus/arm-cci.c > --- a/drivers/bus/arm-cci.c > +++ b/drivers/bus/arm-cci.c > @@ -538,8 +538,10 @@ static int cci_probe(void) > struct resource res; > > np = of_find_matching_node(NULL, arm_cci_matches); > - if (!of_device_is_available(np)) > + if (!of_device_is_available(np)) { > + of_node_put(np); > return -ENODEV; > + } > > ret = of_address_to_resource(np, 0, &res); > if (!ret) { >