Skip to contentSkip to conversation

gpu: drm: amd: amdgpu: fix error return code of amdgpu_acpi_init()

PATCH New Jia-Ju Bai 1 participant 1 message Mar 7, 2021

Subsystems (2)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 gpu: drm: amd: amdgpu: fix error return code of amdgpu_acpi_init()

Add error return code in error hanlding code of amdgpu_acpi_init().

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +5 -1
index 8155c54392c8..156f30d5a2c0 100644
@@ -788,12 +788,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
 
 	/* Probe for ATIF, and initialize it if found */
 	atif_handle = amdgpu_atif_probe_handle(handle);
-	if (!atif_handle)
+	if (!atif_handle) {
+		ret = -EINVAL;
 		goto out;
+	}
 
 	atif = kzalloc(sizeof(*atif), GFP_KERNEL);
 	if (!atif) {
 		DRM_WARN("Not enough memory to initialize ATIF\n");
+		ret = -ENOMEM;
 		goto out;
 	}
 	atif->handle = atif_handle;
@@ -803,6 +806,7 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
 	if (ret) {
 		DRM_DEBUG_DRIVER("Call to ATIF verify_interface failed: %d\n", ret);
 		kfree(atif);
+		ret = -EINVAL;
 		goto out;
 	}
 	adev->atif = atif;
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel