From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBB46C43387 for ; Thu, 20 Dec 2018 09:24:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9778121852 for ; Thu, 20 Dec 2018 09:24:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545297893; bh=Lz6xsGdF/SPKLvCcX4Lg2x4XqNGJ/YP/pUFNzy3Aj9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BKa2cHlEPbRqLxnBb1DTFO41hONjXvWfnHPrzcZzWNPITwopMcS4kxQqf5rlrJUZw xDJ3uguTkRu/xivjndvwO/uH3CB8hoBe3nEKwtQi6Aj1c7/T/8GZ5e9SsUxK3tfjHg XFKUduXWX+YUOQtPi2R59NsPyNkfrvt/CAvbliMU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731885AbeLTJYw (ORCPT ); Thu, 20 Dec 2018 04:24:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:38772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731868AbeLTJYs (ORCPT ); Thu, 20 Dec 2018 04:24:48 -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 69E9920656; Thu, 20 Dec 2018 09:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545297887; bh=Lz6xsGdF/SPKLvCcX4Lg2x4XqNGJ/YP/pUFNzy3Aj9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XJokSFuUCcBV0PJiTplRHbn/NhhQo0lkgkS0mz1igKG/VAkJ0e9z6cxvrm9g6wgGh j7h2wRskV2GN6oipDpIoo32R1EiQqSPKhypNsGS4dQtwVk21INqPe/N8LuoFVXhigQ i3MsehpO+8lrDOUw16K5nLOSc6SmM4JbFDhbN+GI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nicolas Saenz Julienne , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 53/61] ethernet: fman: fix wrong of_node_put() in probe function Date: Thu, 20 Dec 2018 10:18:53 +0100 Message-Id: <20181220085845.903295869@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085843.743900603@linuxfoundation.org> References: <20181220085843.743900603@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.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit ecb239d96d369c23c33d41708646df646de669f4 ] After getting a reference to the platform device's of_node the probe function ends up calling of_find_matching_node() using the node as an argument. The function takes care of decreasing the refcount on it. We are then incorrectly decreasing the refcount on that node again. This patch removes the unwarranted call to of_node_put(). Fixes: 414fd46e7762 ("fsl/fman: Add FMan support") Signed-off-by: Nicolas Saenz Julienne Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/fman/fman.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fman/fman.c b/drivers/net/ethernet/freescale/fman/fman.c index dafd9e1baba2..380c4a2f6516 100644 --- a/drivers/net/ethernet/freescale/fman/fman.c +++ b/drivers/net/ethernet/freescale/fman/fman.c @@ -2817,7 +2817,7 @@ static struct fman *read_dts_node(struct platform_device *of_dev) if (!muram_node) { dev_err(&of_dev->dev, "%s: could not find MURAM node\n", __func__); - goto fman_node_put; + goto fman_free; } err = of_address_to_resource(muram_node, 0, @@ -2826,11 +2826,10 @@ static struct fman *read_dts_node(struct platform_device *of_dev) of_node_put(muram_node); dev_err(&of_dev->dev, "%s: of_address_to_resource() = %d\n", __func__, err); - goto fman_node_put; + goto fman_free; } of_node_put(muram_node); - of_node_put(fm_node); err = devm_request_irq(&of_dev->dev, irq, fman_irq, 0, "fman", fman); if (err < 0) { -- 2.19.1