diff --git a/arch/x86/events/zhaoxin/uncore.c b/arch/x86/events/zhaoxin/uncore.c index 19264e48db5d79fc8b89c894c40b407b947d9c53..a8245771cf5d0140a962e245ea3996ef6ddbb437 100644 --- a/arch/x86/events/zhaoxin/uncore.c +++ b/arch/x86/events/zhaoxin/uncore.c @@ -1671,6 +1671,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; @@ -1681,6 +1682,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; @@ -1691,7 +1693,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; }