Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3821213imj; Tue, 19 Feb 2019 10:00:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IZ+zCT1xLYTCBalx88XGG6C9yKL/twbVNJQCSYeUXgOE9pol/PM9vXSsFCFqQx+57k184Wd X-Received: by 2002:a17:902:8b82:: with SMTP id ay2mr31810056plb.64.1550599216666; Tue, 19 Feb 2019 10:00:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550599216; cv=none; d=google.com; s=arc-20160816; b=ASlIln7BTv5/g8rO9wlBqn3gxsQ83KY+R0jPQ/czw+9EQ4wHAL4d1OU4nLw4OYIESZ hKz8hyojkRE7yBNFjBHSnJE7ijQ0AqqmV4W2P7qQ/W1pO2s+agbVsFbPoAE0kUEqOZ2m HiTz9tSX/mX74BhLTamkzYcjA53kZoDsNBxx1rvuMe/MkUXrWbM4CHXs/NRfrNNGFEvR PCUlwN6/Lv9LqUNZNGq/dTHedghfbnDwqYe61+acsBHWsx/o3bKieZBoWn+dVESKbhZG 5WQwPEumgjY1VB4TtpOKWdZ38Fzw5n8rOjZjRCUBnyD170Ftbay+rH1C1jACQf+lkIAN W6Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FN8YlEqzU3LNdokymE7GWcF/nMNusPVvN1fG0t0AjZc=; b=Fu2CxEPEPq27Sp/5VpM3WHKxGUbkezodukbDvzFJMA3W2xCiIZDuhVtRVPglkNqAlA wSQnwRITe31/I/RBzOHWYfkiVCnOHUUfMBuFFza+/K6NaKqPrWzsSaRO4FT08fRa9S9l qCDsmatlx5YZJZiebB5yONVg4IRdPKfTInRYNZD7dQHz1mPUs8xURJfqfVTf9MdjDPZT n2jYo5he6foQBpihM6ICYaji6f1mBcQ+3XAzXkE/5Kfy2lLH7R2Onnaz+hRJVPTD//Gc BPwoacxyMkbRHApQm4woRNTbquCx4izBNwGbm+rA6zDQS49WI7rniswfSgmL07UBquy2 ogeg== ARC-Authentication-Results: i=1; mx.google.com; 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 q2si15461487pgv.124.2019.02.19.10.00.00; Tue, 19 Feb 2019 10:00:16 -0800 (PST) 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; 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 S1727079AbfBSR6S (ORCPT + 99 others); Tue, 19 Feb 2019 12:58:18 -0500 Received: from muru.com ([72.249.23.125]:39706 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726215AbfBSR6S (ORCPT ); Tue, 19 Feb 2019 12:58:18 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id A56EB80B6; Tue, 19 Feb 2019 17:58:27 +0000 (UTC) Date: Tue, 19 Feb 2019 09:58:14 -0800 From: Tony Lindgren To: Julia Lawall Cc: Peng Hao , linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tomi Valkeinen , Rob Herring , devicetree@vger.kernel.org, wen.yang99@zte.com.cn Subject: Re: [PATCH] arm/mach-omap2/display: fix possible object reference leak Message-ID: <20190219175814.GO15711@atomide.com> References: <1550071969-86286-1-git-send-email-peng.hao2@zte.com.cn> <20190219170516.GL15711@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Julia Lawall [190219 17:33]: > On Tue, 19 Feb 2019, Tony Lindgren wrote: > > In general, if the device tree node is never used afterwards, > > should this be just: > > > > r = of_platform_populate(node, NULL, NULL, &pdev->dev); > > of_node_put(dev_node); > > if (r) { > > ... > > } > > > > If so, Julia might have a Coccinelle recpipe for it? > > Unfortunately this is not really an ideal case for Coccinelle, because > node is the result of calling a local function and Coccinelle doesn't by > default do any interprocedural analysis. It is possible to write a rule > that explicitly looks for one function that returns a device node and then > the pattern of its usage in the caller, though. OK thanks for the information. Regards, Tony