Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp250568yba; Mon, 1 Apr 2019 05:51:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8//q7FgScTiPpuwo2HaGlcZb5UYHqQgmy5PuQfVCtYzo7KZBMiUxOGcJrcuWT5MYJU57L X-Received: by 2002:a62:2687:: with SMTP id m129mr12418288pfm.204.1554123071424; Mon, 01 Apr 2019 05:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554123071; cv=none; d=google.com; s=arc-20160816; b=AXq7rZLnweUntiJ4x+slm90i7HJ0DQXgU+HsFT5dQWaVOtqjkU+aPqZdZQadOczWzh 7fThkYOFPLdEsAK+cRCaEumL/qnzMkx9TtgIkuwgEKsjtvp0NeD00Gc+oUMwJNoiwSHU hwDPXyjucumPdm81Mfv6xneIjQYuzMcapGaD3097OCVqVilnno+SynAWQZf3WQV5Db1M 6nOY8R3d+Bf3LqC+IYH2ZvEW78AFmKzYP5fxUZ8GJHXN0Jd7uOYl85gMsM4CSj13slc/ Rx9ek3B2lbWgVS/quClK6aQH+AuGUUWmpdMBNLRqpOE1Obj87fQhpwUQSfhS+aBCT41g 2B0g== 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=qBw9SZU/uDB8oMRIMN7byW8nUxhl7uvvWlwPjlsY43Q=; b=KgJdCFvxE8QRERBU1Mg+DxJKAhAqTSC6/8MZ8fKGu5ZWYzfvo2N5XN1OQvV/VxNWXB Y+2kkxcNreWLzp4THmVhPft/F9dwH7UcnVSn0ABWfNmQf73aCGrHocG1rfApOWoXWjzl xpNkUbWgJ63y7SBCtVNg6SHfib3l/6tViz8jbkWUv45a91kTn0Rn+WpgnwO4QVfFkyj0 +mfVd1YpkIN2ezccFJK0L1bZ+iJeOswQbRiyzOx3q99/KDI1pUjOrvu8FgduIKtuoxmL KJG8kirk/DZ4FcG4Yr6l8TEgJdfJJ3U/ERHH34a9541x7DRI+t8egNizHhzXts1WTs7M HwkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="P/URqXVH"; dkim=pass header.i=@codeaurora.org header.s=default header.b=JcZvtZ4N; 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 94si8970278plc.298.2019.04.01.05.50.56; Mon, 01 Apr 2019 05:51:11 -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="P/URqXVH"; dkim=pass header.i=@codeaurora.org header.s=default header.b=JcZvtZ4N; 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 S1726977AbfDAMt4 (ORCPT + 99 others); Mon, 1 Apr 2019 08:49:56 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:44086 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfDAMt4 (ORCPT ); Mon, 1 Apr 2019 08:49:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8C024608D4; Mon, 1 Apr 2019 12:49:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122994; bh=6QEKADiCw6eiXlGIMtq0jYA0TzsyZUqa74BENcomYLo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=P/URqXVHY8hM58y1zklf57wm79I2deIzE7nUlRG5tyEmvRVnZDeHa88iOxQRJ0Thi NHKy6iEh6mY1Ehts54GauBvX/Se/mtKpUdwlvnhxJ8+3PNfWiY8t05ueYfOeXy9V9T Jmj4JuNV3vWVokVCw1WEZ2lCArdrrdYKOc7X/vd4= 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 14B1C6081E; Mon, 1 Apr 2019 12:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122993; bh=6QEKADiCw6eiXlGIMtq0jYA0TzsyZUqa74BENcomYLo=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=JcZvtZ4NXyRb+UqKBDOXemAPkFVCpB/dJu0PQu8K9gBQaXXlTeSlsBVWhUvk8uZlC TtQFnHkhI58wxyYuGh6sGifNWjN/W+oW7G/CcgXuerXMQrnHBT067G482Xvd+PuYIy +Eo8OaKu+CRfmeAUX03Cm2ftemX4jYjbNMe5tDsk= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 14B1C6081E 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 03/12] PowerPC-83xx: add missing of_node_put after of_device_is_available To: Julia Lawall , Scott Wood Cc: kernel-janitors@vger.kernel.org, Kumar Gala , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> <1550928043-14889-4-git-send-email-Julia.Lawall@lip6.fr> From: Mukesh Ojha Message-ID: Date: Mon, 1 Apr 2019 18:19:45 +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-4-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: c026c98739c7e ("powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers") > Signed-off-by: Julia Lawall Reviewed-by: Mukesh Ojha Cheers, -Mukesh > > --- > arch/powerpc/platforms/83xx/usb.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff -u -p a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c > --- a/arch/powerpc/platforms/83xx/usb.c > +++ b/arch/powerpc/platforms/83xx/usb.c > @@ -221,8 +221,10 @@ int mpc837x_usb_cfg(void) > int ret = 0; > > np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr"); > - if (!np || !of_device_is_available(np)) > + if (!np || !of_device_is_available(np)) { > + of_node_put(np); > return -ENODEV; > + } > prop = of_get_property(np, "phy_type", NULL); > > if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) { >