Commit a6dd1598 authored by Antonio Quartulli's avatar Antonio Quartulli Committed by Alex Deucher
Browse files

drm/amdgpu: prevent NULL pointer dereference if ATIF is not supported



acpi_evaluate_object() may return AE_NOT_FOUND (failure), which
would result in dereferencing buffer.pointer (obj) while being NULL.

Although this case may be unrealistic for the current code, it is
still better to protect against possible bugs.

Bail out also when status is AE_NOT_FOUND.

This fixes 1 FORWARD_NULL issue reported by Coverity
Report: CID 1600951:  Null pointer dereferences  (FORWARD_NULL)

Signed-off-by: default avatarAntonio Quartulli <antonio@mandelbit.com>
Fixes: c9b7c809 ("drm/amd: Guard against bad data for ATIF ACPI method")
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20241031152848.4716-1-antonio@mandelbit.com


Signed-off-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 91c9e221)
Cc: stable@vger.kernel.org
parent 694c7976
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment