Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp251960ybi; Wed, 29 May 2019 20:41:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwlxKf37eB1PeubpO1OeYedzOg0gK6myhlJsAOjzUFvBkr8ltZjCKn/8K5VVieSDIjLSxLg X-Received: by 2002:a17:902:404:: with SMTP id 4mr1700771ple.204.1559187670008; Wed, 29 May 2019 20:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559187669; cv=none; d=google.com; s=arc-20160816; b=0hjRDwh+0m1iDMkxqcmxaZrLPO3PmSrGqh6PFRBHwznCUdi5wOyH+XrFJ9Z1k8s0B3 Wzuvv9w+94R5uGB2ADYkZl3/Djb+gpfAen0U1ipynyAsrPCsyXcLgLLWFZHc4N32OV0Q 2FQ7flMmNDpbFid7oxKW/7dbTkVHKWpGLLUkBljDgYj1X2hZ1Vx4IXOJywLBJ4NLGpSX kRt4/1pTLtTzl3DLLciGACpsSSnXZ18U1G9GtQTvIg1pewe5TPbaBzzsEfkNPUfBaM7g WFfSCEws7ix8nb3ISGMEEwdWwS/RmaKXeei35x8kVHzPWKkls8jEm/aZnur00K4cgxeI RIaw== 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=8yEvEKBt9Y2UNz+am2RyH6wSk86SQKA5gkcYUBzOuCE=; b=ZCxLTc25jxhmfStY82P2Cmio5Nb/epo+HTTXx4557Bkh3KhntC6O2lAIkX5cpvfrnu KEn8y2oKgtyCl3u22onTVd0jDQmVBjXzxArlQd7KNY56+ywJg3gJHDUvMKE3Gph6lkim c7N7SuZVopndYVbca8MUNoimYzOtF4OASk4vG42/dORY2BUnIjHWJfnvBGA75GMfGyzH 8Gm4DRPtnZf16y+z276588NvQ87lOWurRpFYL8j7IByAoQ5o756gZa4/dyW+QImtytZ6 wRtAp+JNxN9TH+5au2gYZboIPxhAssRs2YEH7JIDQjQZxsBeO4GXW3JA+ua4+Qn7h+gl rU2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2pR9UYYm; 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 c3si1858516pgm.568.2019.05.29.20.40.53; Wed, 29 May 2019 20:41:09 -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=2pR9UYYm; 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 S1732896AbfE3DWq (ORCPT + 99 others); Wed, 29 May 2019 23:22:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:44738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730902AbfE3DRD (ORCPT ); Wed, 29 May 2019 23:17:03 -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 954602465C; Thu, 30 May 2019 03:17:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186222; bh=ES6TSm92Nr2A+PgfWeIlAtLSD3GvoIMI0jJW/rF6MS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2pR9UYYmCyhokBOna+HNZLaQpMIens7n81fgOAyUCuEEnjcUBA2xl5GV3wUhtUBsu cfAIYiYaWneBlGbIl2e3kwC9tqJWwuMMkh+HJQ/9qzNuClJy+VXAM2seXS77vbunCd VgPgPZ5ZDh/MG6CWoSR+JueqnpClu2XUPKLJ4Ucc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Yang , Linus Walleij , linux-gpio@vger.kernel.org, Sasha Levin Subject: [PATCH 4.19 116/276] pinctrl: pistachio: fix leaked of_node references Date: Wed, 29 May 2019 20:04:34 -0700 Message-Id: <20190530030533.171172569@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 44a4455ac2c6b0981eace683a2b6eccf47689022 ] The call to of_get_child_by_name 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/pinctrl-pistachio.c:1422:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 1360, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Linus Walleij Cc: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-pistachio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index 302190d1558d9..0d7d379e9bb80 100644 --- a/drivers/pinctrl/pinctrl-pistachio.c +++ b/drivers/pinctrl/pinctrl-pistachio.c @@ -1368,6 +1368,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) if (!of_find_property(child, "gpio-controller", NULL)) { dev_err(pctl->dev, "No gpio-controller property for bank %u\n", i); + of_node_put(child); ret = -ENODEV; goto err; } @@ -1375,6 +1376,7 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) irq = irq_of_parse_and_map(child, 0); if (irq < 0) { dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq); + of_node_put(child); ret = irq; goto err; } -- 2.20.1