Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6255798imu; Mon, 21 Jan 2019 05:57:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN6m8PRzOlaNiLEARnBEPC7uHcwAe7BEXjkB99UsdMGIcK0k34cFuagupIdYge3Ej4sh3nqD X-Received: by 2002:a63:5252:: with SMTP id s18mr28121376pgl.326.1548079048321; Mon, 21 Jan 2019 05:57:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548079048; cv=none; d=google.com; s=arc-20160816; b=0WWVeRrixIY2zAeHtpn9IxDVwtdoJ2OTX0+E9XaEh0bvcg2rFoYBdgIC8S+aDv4VVF fFQb3SvTs5Jc4TmH/xhkbm6ZOI2LPZfD9gUm1eMm3oCDZlsKhLxon+WaW58cvbRXzDmn SsgLcSIMC+ELnbJtx53w1cn3TOtaVrsKVvLmNLAkWOAMqCR8za18v9kspMyH8T0boawO Zjey5+6iZp5NOORSYxf+SVCDQRcTSwuX65lOBjTB1NFdDatfM4XLBk93e5j83BgtkdfI bFkO7PYHm1blDG+KYxs6g+rv/kpudOair8Rz8CyhoR68JcEzA9Rjsj2CrZs/hKMsy0rI Y7og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IxA+1ZdDLLnFdqF+bJVzWSIrrvIFj6dNcNc8ioFKYDc=; b=KjaIqn1EsjzFpoYOR0IQCDRdRmXwWIDA3ovEEICgFS9JN0FaiWMf1Gq4dbAqgSQKFE X/LlwEbPGEYXJwoNrYbNA3V0Z0vvpibdU05wEIHtdmLLV+5V6FPNkb0se+I4qbE2NdmU DmFevPm3++ASw3PU+cWt5bc/FOsF+nSGApM8OVl1FhTTAJIRvWMu7tZEuKTL0Ce45LTm MC63EYKyTPocuZnmYtGgeevyQO/Gk3pxnllBhxamZvz5smUuOyT1/8qJD9KVHkZt9xJx QOs0k275Ons1nDD7lAaSWkA492CoZg5GtaFbuWjGWOeExqZUj+PKtSAMOZlT2o/lJd6K sSbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tJ+gcSaV; 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 3si12489771plv.258.2019.01.21.05.57.12; Mon, 21 Jan 2019 05:57:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b=tJ+gcSaV; 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 S1731464AbfAUNyT (ORCPT + 99 others); Mon, 21 Jan 2019 08:54:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:38398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731457AbfAUNyR (ORCPT ); Mon, 21 Jan 2019 08:54:17 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D0BC2084C; Mon, 21 Jan 2019 13:54:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548078856; bh=rp+Gn/oITmHk8Tw5EnsncLeitXtEYK0Ik8TtaMbzoLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tJ+gcSaVIRSW0JZgjJzP56DqHtNZHnweZW9wTDXmJSLRbyxzetiAE7EX43imC+657 Ao+B9aLSnyAHvAvDpZALat7zj8lJXK55XtLkyVAKN5u5kuUS4eQ/mKQypJKlUvvRI1 +eM9o99cxdF4MGEBqjrCpLSp2Djyddrs0G12ejwU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julia Lawall , Rob Herring Subject: [PATCH 4.14 31/59] OF: properties: add missing of_node_put Date: Mon, 21 Jan 2019 14:43:56 +0100 Message-Id: <20190121122500.064006559@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121122456.529172919@linuxfoundation.org> References: <20190121122456.529172919@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Julia Lawall commit 28b170e88bc0c7509e6724717c15cb4b5686026e upstream. Add an of_node_put when the result of of_graph_get_remote_port_parent is not available. The semantic match that finds this problem is as follows (http://coccinelle.lip6.fr): // @r exists@ local idexpression e; expression x; @@ e = of_graph_get_remote_port_parent(...); ... when != x = e when != true e == NULL when != of_node_put(e) when != of_fwnode_handle(e) ( return e; | *return ...; ) // Signed-off-by: Julia Lawall Cc: stable@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Greg Kroah-Hartman --- drivers/of/property.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -810,6 +810,7 @@ struct device_node *of_graph_get_remote_ if (!of_device_is_available(remote)) { pr_debug("not available for remote node\n"); + of_node_put(remote); return NULL; }