Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp248359yba; Mon, 1 Apr 2019 05:48:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3CP1xqwga9c6dw0VRBwdMv55K8/vX7+Z8vM+mNSnAU7ouBqNFwQaDrfmNgZHEsWlXDRsk X-Received: by 2002:a63:525f:: with SMTP id s31mr59948575pgl.172.1554122885449; Mon, 01 Apr 2019 05:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554122885; cv=none; d=google.com; s=arc-20160816; b=xcnUEoARJ3JY9QG2++K3T4bzxZkeLHTClIQ/D+tqCzlzY4FuwwHLIfdyx7omqw4Ne0 M+53ckUDgYhd85j9ueTZKTUT3Q4q44NrNpyXysYC8xOU252xVZFtFU//u7D5Jh03M/qJ EJCtghz+1Za/CehDVU561wE5HYxarmZBiW1T5ZpfuUpIqjZJnE3OtBU/J92UIuwEmfNf tkppf1xNKc+Timm76Gk+vDLk9PiiRT6aLCF76ffffpLYsUApRRK5maZboUIe7Zvxxd1V BUoxmcVs3kkzovosNBWhUwcAzuJIXNVqNYyd73mUAF9CuYmuKJisNaCwqAiAOqcKw+xT Vyow== 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=OgJ8vumgW+bZpZRc1oj7XV1Idh9QkoSHnI9AR39pT8I=; b=PVJMpMoJCe+VThBa+/bAviIsiHtjFVShoTPYdENB9Xt7FcJTH7Nl3Cmvve9NIPgpp0 P6mUWB6Li4f/+gkJh9VYZJKuTAxwuLXnnYga2A1I9TAfyCkzU/TZ+231ezVx2T9IpNCB v4273Rx145zeC2Ijk46U3Up7BNpYPJ9mYC/osvbLZcEVagbnLoRbjZf3VkaH/VI2aEZT JCK01k69dVztuG+LkvRGO2Bnsw2p9L06pZGGMxHPF3vpFgMRN800Ov0tUptpowttAtPc +baSoayDX35hm8VxHJxnrUbeez5aof3WFodXZu/CSxV+pyO2IW7MdtS+xS7ixdHZGN1Y lptQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=A7zAAj0b; dkim=pass header.i=@codeaurora.org header.s=default header.b=DXbA+KoZ; 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 p15si4024528pgm.381.2019.04.01.05.47.48; Mon, 01 Apr 2019 05:48:05 -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=A7zAAj0b; dkim=pass header.i=@codeaurora.org header.s=default header.b=DXbA+KoZ; 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 S1726637AbfDAMrN (ORCPT + 99 others); Mon, 1 Apr 2019 08:47:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:37264 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbfDAMrN (ORCPT ); Mon, 1 Apr 2019 08:47:13 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 2780960779; Mon, 1 Apr 2019 12:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122832; bh=iO570D9c/SeXl1+zXFPXhz4P9wddi3r2e2pcW4ldUsQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=A7zAAj0bC+LMghckWbKqUI2Gn2Py0pCurcGfN5Fy4UZhonmXz1PVfkr0wt8Sx9925 PLYW0Ev0Bpv/kJ+K5fZFW0FhheLG5Gy4UKLH9tUzGfdTfpXe2E6+f25HpiFJL/jpVf mpT8IfxwK+S9L2G59f5GPp3iFSYYQEZBM/tKugRQ= 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 BF77060452; Mon, 1 Apr 2019 12:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122830; bh=iO570D9c/SeXl1+zXFPXhz4P9wddi3r2e2pcW4ldUsQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=DXbA+KoZKVqVf4fN9kxVMkc7xbJbGs4337+sen+dUy36RLCihgwtbxqoOps3zabhL +FUVgUGcdl8dJzBj2oOiyu3RFM6Y6gCXmiCnCF7tna+VT3Aqu2jroWhvLq6FxVUuyJ oPsqASovMKYnNgmniKb9hteSjIrDLJz3tvI+L/e4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BF77060452 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 12/12] drivers: firmware: psci: add missing of_node_put after of_device_is_available To: Julia Lawall , Mark Rutland Cc: Lorenzo Pieralisi , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> <1550928043-14889-13-git-send-email-Julia.Lawall@lip6.fr> From: Mukesh Ojha Message-ID: <9b159e80-1ad2-0254-9543-852e1d7f04f9@codeaurora.org> Date: Mon, 1 Apr 2019 18:17:03 +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-13-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://Reviewed-by: Mukesh Ojha > > Cheers, > -Mukesh.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: d09a0011ec0d5 ("drivers: psci: Allow PSCI node to be disabled") > Signed-off-by: Julia Lawall Reviewed-by: Mukesh Ojha Cheers, -Mukesh > > --- > drivers/firmware/psci.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff -u -p a/drivers/firmware/psci.c b/drivers/firmware/psci.c > --- a/drivers/firmware/psci.c > +++ b/drivers/firmware/psci.c > @@ -677,8 +677,10 @@ int __init psci_dt_init(void) > > np = of_find_matching_node_and_match(NULL, psci_of_match, &matched_np); > > - if (!np || !of_device_is_available(np)) > + if (!np || !of_device_is_available(np)) { > + of_node_put(np); > return -ENODEV; > + } > > init_fn = (psci_initcall_t)matched_np->data; > return init_fn(np); > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel