From patchwork Thu Jan 24 20:45:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Tull X-Patchwork-Id: 10780131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A92701515 for ; Thu, 24 Jan 2019 20:46:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 995E62F93F for ; Thu, 24 Jan 2019 20:46:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DB5E2F966; Thu, 24 Jan 2019 20:46:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AD492F93F for ; Thu, 24 Jan 2019 20:46:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725974AbfAXUqC (ORCPT ); Thu, 24 Jan 2019 15:46:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:52470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfAXUqC (ORCPT ); Thu, 24 Jan 2019 15:46:02 -0500 Received: from atull-730U3E-740U3E.fm.intel.com (unknown [192.55.54.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FABD218D0; Thu, 24 Jan 2019 20:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548362762; bh=b3ML7LL6HxXDmi/kR6Z3xAVmvrRzGt49J1PdUY9aejc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=StBy9htgniNmj9hax1VD3FZj/nH+DiH1vB9S/IsaNOq74fiRPhWUg+3uW5+AI3Tfz 4evOhKXFJLopj6CcNANNSyCJfneI8ETZyf91YIpb3XHdyoQ0UoMY9Gzq6GH0MZd79T rNvEQV1XI7GjBcPI/1AyQcOXw9CZdFpYkkk0zCGA= From: Alan Tull To: Greg Kroah-Hartman Cc: Moritz Fischer , Dinh Nguyen , Alan Tull , linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, Nicolas Saenz Julienne Subject: [PATCH 1/3] fpga: stratix10-soc: fix wrong of_node_put() in init function Date: Thu, 24 Jan 2019 14:45:52 -0600 Message-Id: <20190124204554.5438-2-atull@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190124204554.5438-1-atull@kernel.org> References: <20190124204554.5438-1-atull@kernel.org> MIME-Version: 1.0 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Nicolas Saenz Julienne After finding a "firmware" dt node stratix10 tries to match it's compatible string with it. To do so it's calling of_find_matching_node() which already takes care of decreasing the refcount on the "firmware" node. We are then incorrectly decreasing the refcount on that node again. This patch removes the unwarranted call to of_node_put(). Fixes: e7eef1d7633a ("fpga: add intel stratix10 soc fpga manager driver") Signed-off-by: Nicolas Saenz Julienne Acked-by: Alan Tull Acked-by: Moritz Fischer --- drivers/fpga/stratix10-soc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c index a1a09e0..e75dbe5 100644 --- a/drivers/fpga/stratix10-soc.c +++ b/drivers/fpga/stratix10-soc.c @@ -509,13 +509,11 @@ static int __init s10_init(void) np = of_find_matching_node(fw_np, s10_of_match); if (!np) { - of_node_put(fw_np); return -ENODEV; } of_node_put(np); ret = of_platform_populate(fw_np, s10_of_match, NULL, NULL); - of_node_put(fw_np); if (ret) return ret;