diff --git a/arch/x86/events/zhaoxin/uncore.c b/arch/x86/events/zhaoxin/uncore.c index a06342387814a5cc7221e21136caf01690b7e357..eb5f434fafbf71bb666cbc99ad1175912eb3792d 100644 --- a/arch/x86/events/zhaoxin/uncore.c +++ b/arch/x86/events/zhaoxin/uncore.c @@ -1669,6 +1669,7 @@ static void uncore_pci_remove(struct pci_dev *pdev) struct zhaoxin_uncore_box **boxes = pci_get_drvdata(pdev); struct zhaoxin_uncore_box *box; struct zhaoxin_uncore_pmu *pmu; + const char *name; int subnode_id; int i = 0; @@ -1678,6 +1679,7 @@ static void uncore_pci_remove(struct pci_dev *pdev) again: box = boxes[i]; pmu = box->pmu; + name = box->pmu->type->name; if (WARN_ON_ONCE(subnode_id != box->subnode_id)) return; @@ -1688,7 +1690,7 @@ static void uncore_pci_remove(struct pci_dev *pdev) uncore_box_exit(box); kfree(box); - if (!strcmp(box->pmu->type->name, "mc0")) { + if (!strcmp(name, "mc0")) { i++; goto again; }