Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6875963imu; Mon, 3 Dec 2018 04:23:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/XaoUmc0WMPF/x3vOARYDHWdQdYUVftR0So64/NqTdZszaPndcD/9UFcckvro82yZgwu0Hx X-Received: by 2002:a17:902:824:: with SMTP id 33-v6mr16099464plk.107.1543839799895; Mon, 03 Dec 2018 04:23:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543839799; cv=none; d=google.com; s=arc-20160816; b=mKeb/nuhTMABuPqgodPMV511J16na6D1rmQ4cYc/JJ7//D+D6AqOg1Zw1+6rS0uQC8 xZCqbYCoD6n6FCpz98BnKH2xnxH2nAivtOhnwM8iH7FdFEf7KMRpFkqLmD2+rrNNznNA M6ek1Jhull+j8/vrI6GvAHCp92SNiZ/XbjOB1VuLms7rV8edo4ATm5uB2diU2Vsv38gA 5Vqag5BELOqWhStIXdx/eRzKefFpg/q/c4wPrvmUEv4xjo1P+Sc4e5rk7a1AnY3djhw/ qCoNbaIKgOKEMsrGo90HyP36UJdTXeWvWy1aRfIrjLavvQdzC0xUjPDaPcCLXlnmK/0I DwDw== 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 :message-id:date:subject:cc:to:from; bh=YqsIm99g1qeaEzzL72hqeIP4fo8OBv4DIbUgsQaQVa8=; b=JAKxzWsETvLADzqGEfVephnaSEGgBX3guooojlsZ8BVyGeBcgLmvcS1L7Xs3Md/+tK ZyTlLS0O6IezWMe6/Et4h07L8I5jPdXRrNdHV5ekuA7fhmIgNsLoMfsK2BhVP6ULvS/a iRLWCfEfvlM/3FF+/gHB3tygszXP6slEjyp1q9K03jQ00Vhd/mEsATm3geg8yoSYAl+X yPA9bF1v9pe15fM5slp96qrODWViORSZhoaCgJ8z/YgAGtamx4vR2Ku/Rb7rXMTpaswy jtd1lXIYraJf5RuGFErJfLDc73FvKPIWmFz0F+PG+kfA8ksmnfgbd8Ox4KmJJuGLqCJq F+4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 t5si13141277pgm.79.2018.12.03.04.23.05; Mon, 03 Dec 2018 04:23:19 -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; 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 S1726604AbeLCMWv (ORCPT + 99 others); Mon, 3 Dec 2018 07:22:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:36096 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725975AbeLCMWv (ORCPT ); Mon, 3 Dec 2018 07:22:51 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7D8D9AFD4; Mon, 3 Dec 2018 12:22:00 +0000 (UTC) From: Nicolas Saenz Julienne To: Alan Tull , Moritz Fischer Cc: Nicolas Saenz Julienne , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fpga: stratix10-soc: fix wrong of_node_put() in init function Date: Mon, 3 Dec 2018 13:21:45 +0100 Message-Id: <20181203122145.1534-1-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 a1a09e04fab8..e75dbe583152 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; -- 2.19.2