[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210520081646.6296-1-colin.king@canonical.com>
Date: Thu, 20 May 2021 09:16:46 +0100
From: Colin King <colin.king@...onical.com>
To: Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
Xinhui.Pan@....com, David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][next] drm/amdgpu/acpi: Fix null check on memory allocation
From: Colin Ian King <colin.king@...onical.com>
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)")
Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index c39f447df21d..b3ee7fb72b81 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -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;
}
--
2.31.1
Powered by blists - more mailing lists