Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp279762yba; Sat, 13 Apr 2019 00:23:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwT2Yq44Y42GEyhB6398pYSg0+sW2ZRsDtK/mRjDSwR4qu6ormuh847mlR++iIl5SFghYmB X-Received: by 2002:a65:6107:: with SMTP id z7mr58033915pgu.313.1555140206963; Sat, 13 Apr 2019 00:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555140206; cv=none; d=google.com; s=arc-20160816; b=sLB1A2/YUGsL9Uc50T62nrVHBfuDTdyXNHa/6cUyp8UJuAmAtDIpHvkMOPMp/gI+ge rBnCDKLid8LA9j6r7c9ZCGr4t0ZhUM+0MX/uRoMjZEVdGzHyYUcr+ADQAN3AHGJyxp7G ITl04U49Jd0gNKPEh0HFsuuqtoDdAPrtWyDb4K/6BCjw5fBsr2yustP6anJwcPmg8750 Zx6aLk70DaOhyD02XqipUDABEfbreNir48yKyy5GnVayTCX35In+7jAQ5JvWkth541Dr MGCWyyhyz3As0Bek/GOug+BxW6MAns/W92nKujNngHDRkb3wIvudWZvIEsdcf9FNyisV sQGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=dFUSkmTsDR2lLvdt0gvAGYwFKk1EbCAzIdD+XQ2Jcq8=; b=pNIF6SpUkXvmeeVlCpo3+3cxxhFxmIAHEqFTsTFmTonW4iBupdeYckR3FNt8EkMwhM UQNgZUAdDY477t+h0fV/IZ7HYRu9wK83J4hSQMK7FSZ2N1yE0+mmnKx4Wzc/AKUbkkEm JnNlSWgsOT/YAZZyVeaxYKuhONiydlfw+WwYGwDLDdvHub6SPRW+H/3vD2iT3ARDBkUz qhPw1c/cJfW22K3aSTaI6hR2p1bPnV/j9c4lVFXXES3Wsk2oRiilgD102KmPrdKSBbTU DshhNnk9UbHeE3TDWIFQ8iokv7oNV1THyY/iR0UiYOqRPTihfUeQR6oP/+KFuRggSBzt YyJA== 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 h24si37976516pgg.226.2019.04.13.00.23.11; Sat, 13 Apr 2019 00:23:26 -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; 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 S1727241AbfDMHUy (ORCPT + 99 others); Sat, 13 Apr 2019 03:20:54 -0400 Received: from www.osadl.org ([62.245.132.105]:36394 "EHLO www.osadl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727197AbfDMHUx (ORCPT ); Sat, 13 Apr 2019 03:20:53 -0400 Received: from debian01.hofrr.at (178.115.242.59.static.drei.at [178.115.242.59]) by www.osadl.org (8.13.8/8.13.8/OSADL-2007092901) with ESMTP id x3D7JfAX003435; Sat, 13 Apr 2019 09:20:29 +0200 From: Nicholas Mc Guire To: Russell King Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Mark Brown , Linus Walleij , Tony Lindgren , Mike Rapoport , Janusz Krzysztofik , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nicholas Mc Guire Subject: [PATCH] ARM: ux500: add missing of_node_put() Date: Sat, 13 Apr 2019 09:14:21 +0200 Message-Id: <1555139666-948-10-git-send-email-hofrat@osadl.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1555139666-948-1-git-send-email-hofrat@osadl.org> References: <1555139666-948-1-git-send-email-hofrat@osadl.org> X-Spam-Status: No, score=-1.9 required=6.0 tests=BAYES_00,DATE_IN_FUTURE_96_Q, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on www.osadl.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_find_compatible_node() returns a pointer with refcount incremented so both in the error path as well as after usage in soc_info_populate() respectively actually b8500_read_soc_id() an explicit of_node_put is needed to release backupram. Signed-off-by: Nicholas Mc Guire Fixes: commit 18a992787896 ("ARM: ux500: move soc_id driver to drivers/soc") --- Problem located with experimental cocinelle script get_maintainer.pl only returns linux-kernel@vger.kernel.org for this file ? Is MAINTAINERS entry missing ? Not really sure about the referenced fixes commit 18a992787896 ("ARM: ux500: move soc_id driver to drivers/soc") the commit log notes only that the driver is being moved and not expected to change (v4.8) but looking at the previous version in v4.7 it does seem that while moving the driver there was also a relevant change to the driver code including the switch to using of_find_compatible_node(). Patch was compiletested with: u8500_defconfig (implies ONFIG_UX500_SOC_ID=y) Patch is against 4.18-rc3 (localversion-next is next-20180706) drivers/soc/ux500/ux500-soc-id.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/soc/ux500/ux500-soc-id.c b/drivers/soc/ux500/ux500-soc-id.c index 6c1be74..e22597d 100644 --- a/drivers/soc/ux500/ux500-soc-id.c +++ b/drivers/soc/ux500/ux500-soc-id.c @@ -203,10 +203,13 @@ static int __init ux500_soc_device_init(void) ux500_setup_id(); soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL); - if (!soc_dev_attr) + if (!soc_dev_attr) { + of_node_put(backupram); return -ENOMEM; + } soc_info_populate(soc_dev_attr, backupram); + of_node_put(backupram); soc_dev = soc_device_register(soc_dev_attr); if (IS_ERR(soc_dev)) { -- 2.1.4