Skip to contentSkip to conversation

drm/amdgpu/acpi: Fix null check on memory allocation

PATCH New Colin King 1 participant 1 message May 20, 2021

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drm/amdgpu/acpi: Fix null check on memory allocation

From: Colin Ian King <[email protected]>

The current null check is checking the wrong pointer atif. Fix this to check the correct pointer atcs.

Addresses-Coverity: ("Uninitialized pointer read")

Fixes c1c4d8efddde ("drm/amdgpu/acpi: unify ATCS handling (v2)")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +1 -1
index c39f447df21d..b3ee7fb72b81 100644
@@ -901,7 +901,7 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
 		goto out;
 
 	atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
-	if (!atif) {
+	if (!atcs) {
 		DRM_WARN("Not enough memory to initialize ATCS\n");
 		goto out;
 	}
Signature · 1 line
2.31.1