Re: [PATCH] perf/x86/intel/uncore: remove dead check

From: Mi, Dapeng

Date: Wed Nov 19 2025 - 05:25:07 EST



On 11/19/2025 5:15 PM, Jiri Slaby (SUSE) wrote:
> pmu cannot be NULL as is taken as a pointer to an array. Remove the
> superfluous NULL check.
>
> Found by Coverity: CID#1497507.
>
> Signed-off-by: Jiri Slaby (SUSE) <jirislaby@xxxxxxxxxx>
> ---
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: Ian Rogers <irogers@xxxxxxxxxx>
> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: "Liang, Kan" <kan.liang@xxxxxxxxxxxxxxx>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Borislav Petkov <bp@xxxxxxxxx>
> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
> Cc: x86@xxxxxxxxxx
> Cc: linux-perf-users@xxxxxxxxxxxxxxx
> ---
> arch/x86/events/intel/uncore.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
> index d6c945cc5d07..e228e564b15e 100644
> --- a/arch/x86/events/intel/uncore.c
> +++ b/arch/x86/events/intel/uncore.c
> @@ -1325,8 +1325,6 @@ static void uncore_pci_sub_driver_init(void)
> continue;
>
> pmu = &type->pmus[UNCORE_PCI_DEV_IDX(ids->driver_data)];
> - if (!pmu)
> - continue;
>
> if (uncore_pci_get_dev_die_info(pci_sub_dev, &die))
> continue;

LGTM.

Reviewed-by: Dapeng Mi <dapeng1.mi@xxxxxxxxxxxxxxx>