Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp270197ybi; Wed, 29 May 2019 21:04:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqw4xshswnpyXkQyB7EEtD603nZ3H8/1KkiCTKJZw+34hVcMM2KWbSc6IWCDpiUuCogKXBcT X-Received: by 2002:a17:902:860c:: with SMTP id f12mr1821846plo.127.1559189062913; Wed, 29 May 2019 21:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189062; cv=none; d=google.com; s=arc-20160816; b=nsLOqcjdkiM+NsUdTb4eJ15hz7dJ2S0+HK0ZxEs3bHfJkzoFlwuUBqljLU9gyXlgDo vDAlHmXZg5VpChwLz2fD1WGECiZzrJ1VEctSmBDHJJ5qZY31wX2q58SnJeCmIQoV37uA zgico70b+GZiacH24dLMu0cUWvsoDcP4i+TCCUzAXD2/zOYvo+r3VpuJmAhIleSsz7Ax /iWBgtCudzQ/lMyfEUYMLYE0vZBUEqC5cDFbjApUbeVdTvM6LjF82rZcvKTPOEr3Yc58 a276CCVDepjCnR9UXeGRTuXnB97M90i0nBRg95P1oJTZABthdC/90cmsTiR5+sF3baLU PTqg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NB3uUJdpp3zXvqB8wtjtFHZM7wR2yg2G+ikP6+xrOv0=; b=Gr7M1YsGzftPIImMBwERv6WhVZlYxs6n2MY6mYLXybn99SUM3oiUL99qPCTd5q0dGI 3Ni06AQ8cus6uo6af8xB0cDgiLC0060STe+Cr0rSrsuNru1aDa9ZFuaAcZrqda17QLIT tY9tmpSTpJAg26TyBJ3IWOXQdAz+twpRqEpP3ShIg7AprC0Aj/kKxniL34obn566Dt25 3hG28X/KZO4ku5MNHEJ/Y7+lXm0TJOy3i8LKRNjyitP9XcoVPZbduyPzVMojToF56aD0 NXqWhxD2Oz0HjapXssimodI5Rd9T7hp7yxbD35lGN+f7JU37R/b30CnQtOc306va1+AT 4jJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SgK5cllY; 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 l7si1879224plg.222.2019.05.29.21.04.07; Wed, 29 May 2019 21:04:22 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SgK5cllY; 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 S1731439AbfE3EDB (ORCPT + 99 others); Thu, 30 May 2019 00:03:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:49390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731360AbfE3DR6 (ORCPT ); Wed, 29 May 2019 23:17:58 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C611D2471D; Thu, 30 May 2019 03:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186277; bh=wu2UiETOHpDMk85zi6HmzdGCjZjRP7IcwSTkCaWKgdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SgK5cllY3erehaeCYQjiBJVgeN/INmlh1hEByLPkMuzS8kbpKAuI8tYSLnC8V8G6I RXi9P3YtDlBTqgmiN5V/UvPDKqO/3L1b3ttg/JPLj/BRhqE2l/vWDjTnXkPPYdw8VR dmV0zDiaZAGLPmtgSurfC4qzc3jbpAcW81rMdILg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wen Yang , "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org, Sasha Levin Subject: [PATCH 4.19 179/276] cpufreq: ppc_cbe: fix possible object reference leak Date: Wed, 29 May 2019 20:05:37 -0700 Message-Id: <20190530030536.493752575@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 233298032803f2802fe99892d0de4ab653bfece4 ] The call to of_get_cpu_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/ppc_cbe_cpufreq.c:89:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 76, but without a corresponding object release within this function. ./drivers/cpufreq/ppc_cbe_cpufreq.c:89:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 76, but without a corresponding object release within this function. Signed-off-by: Wen Yang Cc: "Rafael J. Wysocki" Cc: Viresh Kumar Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/ppc_cbe_cpufreq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c index 41a0f0be3f9ff..8414c3a4ea08c 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq.c @@ -86,6 +86,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) if (!cbe_get_cpu_pmd_regs(policy->cpu) || !cbe_get_cpu_mic_tm_regs(policy->cpu)) { pr_info("invalid CBE regs pointers for cpufreq\n"); + of_node_put(cpu); return -EINVAL; } -- 2.20.1