Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp969224yba; Sun, 31 Mar 2019 18:39:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqylpCVhNxJZ5xaHUMT+bJpf1fLb2fPiXCtPVzJENqGxcAQDaYpdsU5YH8nTn9E6MOje5bbP X-Received: by 2002:aa7:818a:: with SMTP id g10mr59040591pfi.178.1554082766773; Sun, 31 Mar 2019 18:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554082766; cv=none; d=google.com; s=arc-20160816; b=uaLyY4z+g3z3k0tsSjDfs6mvJMyR26YB/ySbW4vJ86LS3vNKd3ouQvlgrzcPQyCRQg zQ/on1pc7XbNd2hRajeRtQgAmasGqBHHY3R20ACAdmQaBXBknl5oQKMOn8vzyLT3qrn3 5SlKU9omb+KAwZLsZb3iPmOjpG7kmeS5h+9QgkOnfJDYcDADiVtY/riiPMqlUjE7Dw84 rcagdwehH5UA4+j5YY4eB5jQrzHOrEwbqzjPog2R1XxiNQ3pjIqdL1Jr8xymISZOOZco V9Bkux0NlslWvTWFaoAwr3aevX3NGyQjsx77/HvGYzeWdd0T17Wp/nwxo5g+2ZcwMjXq Wa9A== 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=a4PCe3GjHm/BZ0eqN4D61E9Thihb8GS+J31MDdDa/g4=; b=IImCpA8GV94kKOTP1cN5dnJKwYRGIgeY0zXNEUjZL1Z2Y4TeM7DE/PMILsjprKp3D2 hx9BxuHf5k1zYpj1CzfKeuP0pwiDriWbaKUKozk2A6WBHNH9pCyIYGOYyPZR+bZvKgpu NmjQQLYJoJPyavFCOWVE5iWFmzU9hLLmkWOxttWI7elovSW1V+MBx31z6ljTg0O7e5Rr w+8OYTcWEjJ3IdKxLojFstvDknMNwnshITJh5nVl+0MNUbgr9bDjGCfDw9FEGeMyaWCj AGcQ1Xqtn74B8WAO7gbPIjTVHzZ6aOrzYB39k7itNTp370Ena8XVD1krEU5KIxjIga8u 5HAw== 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 d3si7605144pgc.461.2019.03.31.18.39.11; Sun, 31 Mar 2019 18:39: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 S1731732AbfDABi1 (ORCPT + 99 others); Sun, 31 Mar 2019 21:38:27 -0400 Received: from out1.zte.com.cn ([202.103.147.172]:32862 "EHLO mxct.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfDABiY (ORCPT ); Sun, 31 Mar 2019 21:38:24 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 630916E9A88795D6508E; Mon, 1 Apr 2019 09:38:23 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x311cI35061268; Mon, 1 Apr 2019 09:38:18 +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 2019040109382171-7035266 ; Mon, 1 Apr 2019 09:38:21 +0800 From: Wen Yang To: linux-kernel@vger.kernel.org Cc: wang.yi59@zte.com.cn, Wen Yang , "Rafael J. Wysocki" Subject: [PATCH 4/7] cpufreq: maple: fix possible object reference leak Date: Mon, 1 Apr 2019 09:37:51 +0800 Message-Id: <1554082674-2049-5-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:21, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-04-01 09:38:18, Serialize complete at 2019-04-01 09:38:18 X-MAIL: mse01.zte.com.cn x311cI35061268 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The call to of_cpu_device_node_get 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/maple-cpufreq.c:213:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 177, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Viresh Kumar linux-pm@vger.kernel.org linux-kernel@vger.kernel.org --- drivers/cpufreq/maple-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c index d9df893..a05f134 100644 --- a/drivers/cpufreq/maple-cpufreq.c +++ b/drivers/cpufreq/maple-cpufreq.c @@ -210,7 +210,7 @@ static int __init maple_cpufreq_init(void) */ valp = of_get_property(cpunode, "clock-frequency", NULL); if (!valp) - return -ENODEV; + goto bail_noprops; max_freq = (*valp)/1000; maple_cpu_freqs[0].frequency = max_freq; maple_cpu_freqs[1].frequency = max_freq/2; -- 2.9.5