[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210624070442.34291-1-13145886936@163.com>
Date: Thu, 24 Jun 2021 00:04:42 -0700
From: 13145886936@....com
To: tglx@...utronix.de, bp@...en8.de, x86@...nel.org
Cc: linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
gushengxian <gushengxian@...ong.com>
Subject: [PATCH] x86: eas should not be NULL when it is referenced
From: gushengxian <gushengxian@...ong.com>
"eas" should not be NULL when it is referenced.
Signed-off-by: gushengxian <gushengxian@...ong.com>
---
arch/x86/events/intel/uncore_snbep.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index bb6eb1e5569c..836aa78cd0f3 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3826,8 +3826,10 @@ pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
return 0;
err:
- for (; die >= 0; die--)
- kfree(eas[die].attr.attr.name);
+ if (eas) {
+ for (; die >= 0; die--)
+ kfree(eas[die].attr.attr.name);
+ }
kfree(eas);
kfree(attrs);
kfree(type->topology);
--
2.25.1
Powered by blists - more mailing lists