projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c61e572
)
perf: arm_cspmu: Fix variable dereference warning
author
Besar Wicaksono
<bwicaksono@nvidia.com>
Thu, 2 Mar 2023 20:57:01 +0000
(14:57 -0600)
committer
Will Deacon
<will@kernel.org>
Mon, 27 Mar 2023 14:12:58 +0000
(15:12 +0100)
Fix warning message from smatch tool:
| smatch warnings:
| drivers/perf/arm_cspmu/arm_cspmu.c:1075 arm_cspmu_find_cpu_container()
| warn: variable dereferenced before check 'cpu_dev' (see line 1073)
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Link:
https://lore.kernel.org/r/202302191227.kc0V8fM7-lkp@intel.com/
Reviewed-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Besar Wicaksono <bwicaksono@nvidia.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link:
https://lore.kernel.org/r/20230302205701.35323-1-bwicaksono@nvidia.com
Signed-off-by: Will Deacon <will@kernel.org>
drivers/perf/arm_cspmu/arm_cspmu.c
patch
|
blob
|
history
diff --git
a/drivers/perf/arm_cspmu/arm_cspmu.c
b/drivers/perf/arm_cspmu/arm_cspmu.c
index e31302ab7e37c3b4decbcf8c230e467e2c836f68..a3f1c410b4173d44137c6906b128711a871e947e 100644
(file)
--- a/
drivers/perf/arm_cspmu/arm_cspmu.c
+++ b/
drivers/perf/arm_cspmu/arm_cspmu.c
@@
-1078,12
+1078,14
@@
static int arm_cspmu_request_irq(struct arm_cspmu *cspmu)
static inline int arm_cspmu_find_cpu_container(int cpu, u32 container_uid)
{
u32 acpi_uid;
- struct device *cpu_dev
= get_cpu_device(cpu)
;
- struct acpi_device *acpi_dev
= ACPI_COMPANION(cpu_dev)
;
+ struct device *cpu_dev;
+ struct acpi_device *acpi_dev;
+ cpu_dev = get_cpu_device(cpu);
if (!cpu_dev)
return -ENODEV;
+ acpi_dev = ACPI_COMPANION(cpu_dev);
while (acpi_dev) {
if (!strcmp(acpi_device_hid(acpi_dev),
ACPI_PROCESSOR_CONTAINER_HID) &&