Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp250152yba; Mon, 1 Apr 2019 05:50:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvVLtq0dBVuGTeXbVxScy6I1CGeTjjT5ZPGRfkaiNUc2fZPUkuTAz2zjDARN+MM7kT48cd X-Received: by 2002:a62:1e82:: with SMTP id e124mr62279183pfe.258.1554123039114; Mon, 01 Apr 2019 05:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554123039; cv=none; d=google.com; s=arc-20160816; b=Wc1mkaVs7JXF/GKRTo6ZgsS9q72J5852bwla7ol6X1xhfdJblm3s7P6hD7rtuzKuiK 9Mhcjkoeo7yzMHlJMmTRVnvQGLPmYvikNuiETXhzOlVDIZWL+h+pgtubWjMWgjH9xT+I IRE0JGWaz4uvCkfU0vjCSopLeH09nGFMW4TyZH2KqRGmrdvZ1cxfptBvonqpCvP6KW5U uvd+gjWE7YP7hIOPU3WarK3ackASN1yMuFEnkhhM85fKW6X9V/glS0PM6egemvGC1Gj1 Fv5INC5tjDIEJicnHvJQQZvga3RYn44DV3vKa6bMhc2NGmItrgFOApCQeZbHk0dAqEU/ 2z6A== 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=w58SQdJBRERe1PetEfYt/M2FbkyFozBcm30w8tjljoE=; b=jt+D6TUMNr/eo6irmwBRF8u04lrPbxEcD7Ah2Kz1OAHo7+25SXOb5XzywsiR9WTwVo SamUC3rlbEN/c7bqK1sFkdJmi/GorVTGuZqvuadaD8hsK89zGSx1Xif+29GszOb2hTGy 6wMxVoYI80VWPBQnfjZBwWG9sBkfhYPWQn1HCXvh2g0L+v/RCeqSD4wq1wLkoM4P8qpg cwhxOF7vVP011MFRqY/Mfo6um2veudCLJAtOder8G8I1LdHX6Gy+UvmWwAWqJuKCNs+i 2CsScmsXYiz5mLtEfSNzCoWlhBAOle8DgD/UKOpaAE7ogttEck36U4H5FMaNgIG6E+WM jVVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=WvYGtiCi; dkim=pass header.i=@codeaurora.org header.s=default header.b=kglmUE+i; 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 i8si8475679pfd.275.2019.04.01.05.50.23; Mon, 01 Apr 2019 05:50: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=WvYGtiCi; dkim=pass header.i=@codeaurora.org header.s=default header.b=kglmUE+i; 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 S1726947AbfDAMt0 (ORCPT + 99 others); Mon, 1 Apr 2019 08:49:26 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:43670 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725882AbfDAMt0 (ORCPT ); Mon, 1 Apr 2019 08:49:26 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4689961382; Mon, 1 Apr 2019 12:49:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122965; bh=ySEDvBf1py517o32EDmhBE2KYnJjP7qKsflXFqgItZ0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=WvYGtiCidsZq9TFOQu3JIocFW0zdQCyq06eWR34/82Q9rr+yllH1JmWlrOBVcLBOh i9NmOQ1uzKIddoLBYcm8LjLeUQ5NIZNbr/IcKIukJrB6POA/kzmZD2VjopS/uReBPc JUMfX5YIRAKGx4gWtcnwUq3I3l4paDDgosjesM6M= 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 3AAC860DAA; Mon, 1 Apr 2019 12:49:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1554122959; bh=ySEDvBf1py517o32EDmhBE2KYnJjP7qKsflXFqgItZ0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=kglmUE+iNPg0MMZbPGn49rwGJpcstsHPFnY+7jKAPkYTZMF9J3R7l+7UYD0Cn6m8v jvnVtSb/fd6RYFM8XTzWPEYT3HsGVcC3ikI0ts3WWTMO0fDChlwkabtLOkXn7A7OlZ LPPp1etSOStJX66G/dzBeYeUp2LkpY7JZDnu/s3c= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3AAC860DAA 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 02/12] drm/tegra: rgb: add missing of_node_put after of_device_is_available To: Julia Lawall , Thierry Reding Cc: kernel-janitors@vger.kernel.org, David Airlie , Daniel Vetter , Jonathan Hunter , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> <1550928043-14889-3-git-send-email-Julia.Lawall@lip6.fr> From: Mukesh Ojha Message-ID: Date: Mon, 1 Apr 2019 18:19:12 +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-3-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: d8f4a9eda0067 ("drm: Add NVIDIA Tegra20 support") > Signed-off-by: Julia Lawall Reviewed-by: Mukesh Ojha Cheers, -Mukesh > > --- > drivers/gpu/drm/tegra/rgb.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff -u -p a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c > --- a/drivers/gpu/drm/tegra/rgb.c > +++ b/drivers/gpu/drm/tegra/rgb.c > @@ -221,8 +221,10 @@ int tegra_dc_rgb_probe(struct tegra_dc * > int err; > > np = of_get_child_by_name(dc->dev->of_node, "rgb"); > - if (!np || !of_device_is_available(np)) > + if (!np || !of_device_is_available(np)) { > + of_node_put(np); > return -ENODEV; > + } > > rgb = devm_kzalloc(dc->dev, sizeof(*rgb), GFP_KERNEL); > if (!rgb) >