lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1573652102-131731-1-git-send-email-kan.liang@linux.intel.com>
Date:   Wed, 13 Nov 2019 05:35:02 -0800
From:   kan.liang@...ux.intel.com
To:     peterz@...radead.org, mingo@...nel.org, sashal@...nel.org,
        gregkh@...uxfoundation.org, pavel@...x.de,
        linux-kernel@...r.kernel.org
Cc:     ak@...ux.intel.com, alexander.shishkin@...ux.intel.com,
        Kan Liang <kan.liang@...ux.intel.com>, stable@...r.kernel.org
Subject: [PATCH] perf/x86/uncore: Remove unnecessary check for uncore_pmu

From: Kan Liang <kan.liang@...ux.intel.com>

The uncore_pmu pointer in uncore_pmu_enable/disable() is from
container_of, which never be NULL.

Remove the unnecessary check for uncore_pmu.

Fixes: 75be6f703a14 ("perf/x86/uncore: Fix event group support")
Reported-by: Pavel Machek <pavel@...x.de>
Signed-off-by: Kan Liang <kan.liang@...ux.intel.com>
Cc: stable@...r.kernel.org
---
 arch/x86/events/intel/uncore.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 86467f8..81eed07 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -780,9 +780,6 @@ static void uncore_pmu_enable(struct pmu *pmu)
 	struct intel_uncore_box *box;
 
 	uncore_pmu = container_of(pmu, struct intel_uncore_pmu, pmu);
-	if (!uncore_pmu)
-		return;
-
 	box = uncore_pmu_to_box(uncore_pmu, smp_processor_id());
 	if (!box)
 		return;
@@ -797,9 +794,6 @@ static void uncore_pmu_disable(struct pmu *pmu)
 	struct intel_uncore_box *box;
 
 	uncore_pmu = container_of(pmu, struct intel_uncore_pmu, pmu);
-	if (!uncore_pmu)
-		return;
-
 	box = uncore_pmu_to_box(uncore_pmu, smp_processor_id());
 	if (!box)
 		return;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ