Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp310247ybi; Wed, 29 May 2019 22:00:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtgk2Enoy2oT9//I7kwm7lMvtglhwPuN74TkfRB9b1Pn3l7C646QX7GZhMP4AB4A0fcTlA X-Received: by 2002:a63:9a52:: with SMTP id e18mr2008973pgo.335.1559192455000; Wed, 29 May 2019 22:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559192454; cv=none; d=google.com; s=arc-20160816; b=JbogzWnTRvTYX64ZOPOybPnpJs5SysqnNTal9QFBHrnW1XwwYG4BBS9CibfZR12FFh eB4r0n4MmPe4g064pfM0kHBlyt10i/kGYxidvfPbOLiB9335dsC9g9kqCroE9pJQWzO+ 554G/rDn1RL8uVbgcE7yhZUHzJ6rE51lWclhn3I0qysNAoaMPrG8dQXqRCq94bIisv54 B4PiUBorM//P6Lhl4oIieW/i0EGEQvp0KFbztqP97KgD1wkRLBw81xLCIkfqOt4A2AXB MjS9Y6jrH1KJTVix6j/PDKYaqpG3BP1v6tuAOi106TFrMsV1e7RtlOidoUXh0RTJyd/0 TydA== 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=iVREg4HpPD1zBVnVA2A9rS0+pGqLzW0auJWNPh4vgyM=; b=IxeKMOdXIEEHoufBIqdnivibPTG9oiU/3iTfHeddPouPfw0+SM6P/Sg3tsHPvvE7sK Q3o136k4YtJMqfO8rleYtRYYAaEpitnCN0UGHzwf5/sZdv8QfahN8y0tgg+VB4AsCgH1 SFRW5SFvkWU2w6fB9kBnrxn5fn/ToxzKNJLahAcQ4IzBdgCXUTmFQ++RTGoAmvdSzmPs Bv+4FbPUib0jYK+t+ro2o+nvhPO59BgzuoCWgVrznl4wPxCpXPWjSLMZhwptKgwSamgT Xn3nI+XUBZiNh3GH4doCrPQ/dWcQcHxoVbT29THkHiBKIrOXCynabVcjfPEb9cDAmsno ULuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NbNAfI3d; 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 f11si2033077pgm.86.2019.05.29.22.00.36; Wed, 29 May 2019 22:00:54 -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=@kernel.org header.s=default header.b=NbNAfI3d; 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 S2389028AbfE3E5i (ORCPT + 99 others); Thu, 30 May 2019 00:57:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:45728 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727696AbfE3DJy (ORCPT ); Wed, 29 May 2019 23:09:54 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 E81A12447B; Thu, 30 May 2019 03:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559185794; bh=aFulq45jcbmOE+rmTiPFUcS+ut7sv6MMNvhjK8ujpNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NbNAfI3dz90hZq9zqUd9HT7HcpKDltpebiB3+KlZV4sechz1bC9qYXL14zQj2aed0 M30Z8IESM0WvjO68tGPWLSQfhDZSo+uRfQY1fGUULva8htdhRCrJAEKdcA0kKl2JpM Y7jMCYi06uvAfY0L+XCJL2B13noTf/MeEYMkz7MU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Yang , Linus Walleij , Jun Nie , linux-gpio@vger.kernel.org, Shawn Guo , Sasha Levin Subject: [PATCH 5.1 068/405] pinctrl: zte: fix leaked of_node references Date: Wed, 29 May 2019 20:01:06 -0700 Message-Id: <20190530030544.374403462@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030540.291644921@linuxfoundation.org> References: <20190530030540.291644921@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 02d15f0d80720545f1f4922a1550ea4aaad4e152 ] The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./drivers/pinctrl/zte/pinctrl-zx.c:415:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 407, but without a corresponding object release within this function. ./drivers/pinctrl/zte/pinctrl-zx.c:422:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 407, but without a corresponding object release within this function. ./drivers/pinctrl/zte/pinctrl-zx.c:436:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 407, but without a corresponding object release within this function. ./drivers/pinctrl/zte/pinctrl-zx.c:444:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 407, but without a corresponding object release within this function. ./drivers/pinctrl/zte/pinctrl-zx.c:448:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 407, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Linus Walleij Cc: Jun Nie Cc: Linus Walleij Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Shawn Guo Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/zte/pinctrl-zx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pinctrl/zte/pinctrl-zx.c b/drivers/pinctrl/zte/pinctrl-zx.c index caa44dd2880a8..3cb69309912ba 100644 --- a/drivers/pinctrl/zte/pinctrl-zx.c +++ b/drivers/pinctrl/zte/pinctrl-zx.c @@ -411,6 +411,7 @@ int zx_pinctrl_init(struct platform_device *pdev, } zpctl->aux_base = of_iomap(np, 0); + of_node_put(np); if (!zpctl->aux_base) return -ENOMEM; -- 2.20.1