* [PATCH] perf/x86/intel/uncore: Fix uninitialized variable in skx_upi_topology_cb()
@ 2022-11-28 15:11 alexander.antonov
0 siblings, 0 replies; 2+ messages in thread
From: alexander.antonov @ 2022-11-28 15:11 UTC (permalink / raw)
To: peterz, linux-kernel; +Cc: kan.liang, alexey.v.bayduraev, alexander.antonov
From: Alexander Antonov <alexander.antonov@linux.intel.com>
Fix the following warning in recently merged patch:
> config: x86_64-randconfig-m001
> compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
>
> smatch warnings:
> arch/x86/events/intel/uncore_snbep.c:4345 skx_upi_topology_cb() error: uninitialized symbol 'ret'.
Fixes: c1c1942b49ea ("perf/x86/intel/uncore: Enable UPI topology discovery for Skylake Server")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Alexander Antonov <alexander.antonov@linux.intel.com>
---
arch/x86/events/intel/uncore_snbep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 44c2f879f708..db6586e12bcb 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -4340,7 +4340,7 @@ static int upi_fill_topology(struct pci_dev *dev, struct intel_uncore_topology *
static int skx_upi_topology_cb(struct intel_uncore_type *type, int segment,
int die, u64 cpu_bus_msr)
{
- int idx, ret;
+ int idx, ret = -ENODEV;
struct intel_uncore_topology *upi;
unsigned int devfn;
struct pci_dev *dev = NULL;
base-commit: 415db869ef56751c4ab72f0f58cd7224213bb357
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] perf/x86/intel/uncore: Fix uninitialized variable in skx_upi_topology_cb()
@ 2023-08-04 17:03 alexander.antonov
0 siblings, 0 replies; 2+ messages in thread
From: alexander.antonov @ 2023-08-04 17:03 UTC (permalink / raw)
To: peterz, linux-kernel; +Cc: colin.i.king, alexander.antonov
From: Alexander Antonov <alexander.antonov@linux.intel.com>
Fix a potential return of an uninitialized 'ret' variable in
skx_upi_topology_cb() function.
Fixes: c1c1942b49ea ("perf/x86/intel/uncore: Enable UPI topology discovery for Skylake Server")
Reported-by: Colin King <colin.i.king@gmail.com>
Closes: https://lore.kernel.org/lkml/21e2ea66-9524-8e34-a2f0-8e16b9617d68@gmail.com/
Signed-off-by: Alexander Antonov <alexander.antonov@linux.intel.com>
---
arch/x86/events/intel/uncore_snbep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index d49e90dc04a4..d857fc00511b 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -4330,7 +4330,7 @@ static int upi_fill_topology(struct pci_dev *dev, struct intel_uncore_topology *
static int skx_upi_topology_cb(struct intel_uncore_type *type, int segment,
int die, u64 cpu_bus_msr)
{
- int idx, ret;
+ int idx, ret = -ENODEV;
struct intel_uncore_topology *upi;
unsigned int devfn;
struct pci_dev *dev = NULL;
base-commit: c1a515d3c0270628df8ae5f5118ba859b85464a2
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-08-04 17:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 15:11 [PATCH] perf/x86/intel/uncore: Fix uninitialized variable in skx_upi_topology_cb() alexander.antonov
2023-08-04 17:03 alexander.antonov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).