Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp2551599imc; Sat, 23 Feb 2019 05:59:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IY0GMbjO2a28U59QxOT7pP4H42jvEaAmsLQet1rqSHp1kbj+nfuDGt/M6q8f2QKa6u1Edex X-Received: by 2002:a17:902:5a8d:: with SMTP id r13mr9575906pli.190.1550930383869; Sat, 23 Feb 2019 05:59:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550930383; cv=none; d=google.com; s=arc-20160816; b=P+HKM/7Ke/8+nHNZJXX3lq+xSScsGOa6xyetby+Es61NlJJfHe8ERcqYk0YZkqY4B5 lEl7kw2KRklsZEgW+JcG3GlpKIbKI6N4tNcRZBxYrtmkG8PqnRHtx462jqsER9AgPUAh jtBsni2yNjxCBcqCbBQFwjQzvRHqIpIbn56r3frmGobuWUaRSdwOLSMzq0AGJkTRIU0Z oY3N8SWcAsXXpU5ZBMW51fTGIFPqRb7+RlYpen1v9qCq+WJfg6djbcWxRgeKEMT7aqQ9 HMKSUyYQdhuAaypDyxfNWAZmygwbWddkZnpEIKBJYSa7jed6IGqrkGPOYQqlIv6QH0+H lzAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=r1zQkh9/F/TO9rBYNQWsLlbgjvzzVlxiQuQjDPoukOM=; b=0txfVt+MqY0RuaZmK5i/nYnqqqV56nYu35CfNUGtcd/htwKKxXSpTaZB0VLy9nSjqr hCtK25q7XzvKrlEHTG68fT0rzIXn4uDUcvEotEG4W+Xbh9RXevVCwBNp69NhnEz1Mjc0 +awXFQfhThdxEudg1D/CR2MqBneVZ6XiZGaDyNVfGPPv5LKKwePtC4UVS+SrbPQXIQCn mQVS3talBOF8Qqe8JFheP5zNu+pg6msv2ea8ZiiJJS5d50SZeBEyNkWWvNIPSr9JkCZn AfTT0iUd9NhZpjeJTWW7WRCzLtA2vRTDtb5h9Pn3RsZgDAXWeSWQy9KDf7agIoCInRUi J/6w== 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 j16si3828173pfa.197.2019.02.23.05.59.28; Sat, 23 Feb 2019 05:59:43 -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 S1728052AbfBWN66 (ORCPT + 99 others); Sat, 23 Feb 2019 08:58:58 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:17560 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727967AbfBWN6v (ORCPT ); Sat, 23 Feb 2019 08:58:51 -0500 X-IronPort-AV: E=Sophos;i="5.58,403,1544482800"; d="scan'208";a="370609505" Received: from palace.lip6.fr ([132.227.105.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA256; 23 Feb 2019 14:58:44 +0100 From: Julia Lawall To: Bartlomiej Zolnierkiewicz Cc: kernel-janitors@vger.kernel.org, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/12] omapfb: add missing of_node_put after of_device_is_available Date: Sat, 23 Feb 2019 14:20:37 +0100 Message-Id: <1550928043-14889-7-git-send-email-Julia.Lawall@lip6.fr> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> References: <1550928043-14889-1-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: f76ee892a99e6 ("omapfb: copy omapdss & displays for omapfb") Signed-off-by: Julia Lawall --- drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -u -p a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c --- a/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c +++ b/drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c @@ -193,8 +193,10 @@ static int __init omapdss_boot_init(void dss = of_find_matching_node(NULL, omapdss_of_match); - if (dss == NULL || !of_device_is_available(dss)) + if (dss == NULL || !of_device_is_available(dss)) { + of_node_put(dss); return 0; + } omapdss_walk_device(dss, true);