Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp969897yba; Sun, 31 Mar 2019 18:40:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvXYVNsFq5gQjUYvAfb7sSgSr+2pVtSYOiXxGft6bT/7ldWFZQJ+YD3HEdA9i6OrMeYyHs X-Received: by 2002:a62:1c13:: with SMTP id c19mr21106730pfc.11.1554082839415; Sun, 31 Mar 2019 18:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554082839; cv=none; d=google.com; s=arc-20160816; b=GvXM1fEGr3LqQFx3aa0A6KOP/73gdISllvHEhcxVjIZJtA6qZdgt1d4o8J+y7B1GuF MAbCu/2pbqolwnqXoRORuPLDHX05Rwzh7SaOKUIAqUAjcTy0EMtWmsXoZ/MZ+iBvR02G 85CRlA1OUWSnf4yIqjs967G4G7w4OPT4vupASLSKq3+P+R/8BH0yNNEHBjLgs5F2IVwt RM81D67K65MBplDIwpCbBEwfryu7sHPSFvqNnx243+b/W/RDLESvlyw+V4tJirzumGKA ++5wKmTNF1XbgUXIcri+0HQDtMC0ri/QyQT8dqxWo7MPv0jrFvwiCcOB2ymUbIsi4BEN gZ+g== 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=BERCnyb/Iq8e/0SaFRY9agEgvGsUsIlolSzbCieUSkA=; b=aXrQiUgxiOYFEp7PtZ/aYzMYKQymKnlnLZFY8sYUrXQB/1yWaEwUy+9xIJyRhS7wvP guahbV1Mje5l8+Bj6ABGq6lM+HPshGZT/k/hKpUGO2r9NWNsBZNoXnobOIluvVre8wTT wArVNhVSneavM5jPNOjbbxzgXg/ooVm9O6fW0wrMzF2wWStkiNax7YEw9wuT+gp8jsac +chnGsSeCOF2xdSqNvaioc7+c1HVfTuNmCq4JRxIPhAa/QbgJpiu61CPdbarbxGzg4aZ XD16ZCojCfldYwK7MIkgGre0CcVpc9rpORUXGXTbA+8EkNzh3FZr3e3301hlwORw21Mw V7qA== 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 l4si7429172pgp.169.2019.03.31.18.40.24; Sun, 31 Mar 2019 18:40:39 -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 S1731839AbfDABiz (ORCPT + 99 others); Sun, 31 Mar 2019 21:38:55 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:32768 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731571AbfDABiU (ORCPT ); Sun, 31 Mar 2019 21:38:20 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 6A67C746CAE50819042B; Mon, 1 Apr 2019 09:38:18 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x311cDsO061195; Mon, 1 Apr 2019 09:38:13 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019040109381645-7035249 ; Mon, 1 Apr 2019 09:38:16 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , "Rafael J. Wysocki" , Viresh Kumar , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 1/7] cpufreq: ap806: fix possible object reference leak Date: Mon, 1 Apr 2019 09:37:48 +0800 Message-Id: <1554082674-2049-2-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1554082674-2049-1-git-send-email-wen.yang99@zte.com.cn> References: <1554082674-2049-1-git-send-email-wen.yang99@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-04-01 09:38:16, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-04-01 09:38:13, Serialize complete at 2019-04-01 09:38:13 X-MAIL: mse01.zte.com.cn x311cDsO061195 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_find_compatible_node 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/cpufreq/armada-8k-cpufreq.c:187:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 130, but without a corresponding object release within this function. ./drivers/cpufreq/armada-8k-cpufreq.c:191:1-7: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 130, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: Jason Cooper Cc: Andrew Lunn Cc: Gregory Clement Cc: Sebastian Hesselbarth Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/cpufreq/armada-8k-cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/armada-8k-cpufreq.c b/drivers/cpufreq/armada-8k-cpufreq.c index b3f4bd6..988ebc3 100644 --- a/drivers/cpufreq/armada-8k-cpufreq.c +++ b/drivers/cpufreq/armada-8k-cpufreq.c @@ -132,6 +132,7 @@ static int __init armada_8k_cpufreq_init(void) of_node_put(node); return -ENODEV; } + of_node_put(node); nb_cpus = num_possible_cpus(); freq_tables = kcalloc(nb_cpus, sizeof(*freq_tables), GFP_KERNEL); -- 2.9.5