Merge tag 'perf-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / arch / x86 / events / intel / uncore_snbep.c
index bb6eb1e..609c24a 100644 (file)
@@ -3804,11 +3804,11 @@ pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
        /* One more for NULL. */
        attrs = kcalloc((uncore_max_dies() + 1), sizeof(*attrs), GFP_KERNEL);
        if (!attrs)
-               goto err;
+               goto clear_topology;
 
        eas = kcalloc(uncore_max_dies(), sizeof(*eas), GFP_KERNEL);
        if (!eas)
-               goto err;
+               goto clear_attrs;
 
        for (die = 0; die < uncore_max_dies(); die++) {
                sprintf(buf, "die%ld", die);
@@ -3829,7 +3829,9 @@ err:
        for (; die >= 0; die--)
                kfree(eas[die].attr.attr.name);
        kfree(eas);
+clear_attrs:
        kfree(attrs);
+clear_topology:
        kfree(type->topology);
 clear_attr_update:
        type->attr_update = NULL;