drm/amd/amdgpu: fix potential memleak
authorjsg <jsg@openbsd.org>
Wed, 8 Dec 2021 11:38:57 +0000 (11:38 +0000)
committerjsg <jsg@openbsd.org>
Wed, 8 Dec 2021 11:38:57 +0000 (11:38 +0000)
From Bernard Zhao
c746945fb6bcbe3863c9ea6369c7ef376e38e5eb in linux 5.10.y/5.10.84
27dfaedc0d321b4ea4e10c53e4679d6911ab17aa in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_xgmi.c

index 6d8e951..64028a8 100644 (file)
@@ -373,6 +373,7 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)
                        "%s", "xgmi_hive_info");
        if (ret) {
                dev_err(adev->dev, "XGMI: failed initializing kobject for xgmi hive\n");
+               kobject_put(&hive->kobj);
                kfree(hive);
                hive = NULL;
                goto pro_end;