diff options
author | Chris Park <[email protected]> | 2022-02-28 10:23:00 -0500 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2022-03-15 14:25:16 -0400 |
commit | 84ce38c7bf7a19fb1f9cc61181e830b7e04dd51d (patch) | |
tree | b7868a4c338545cc578f2aabd023c4b1f787a87c | |
parent | 9c1e260e97606330518a78422ae28d9d56ac87d6 (diff) |
drm/amd/display: Add NULL check
[Why]
Virtualization enters blue screen of death (BSoD)
due to NULL res_pool object when accessing DSC
encoder capability.
[How]
Add NULL check to avoid blue screen of death.
Reviewed-by: Aric Cyr <[email protected]>
Acked-by: Alan Liu <[email protected]>
Signed-off-by: Chris Park <[email protected]>
Tested-by: Daniel Wheeler <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r-- | drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index bc2150f3d79b..7af153434e9e 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -2335,6 +2335,9 @@ void dc_resource_state_construct( bool dc_resource_is_dsc_encoding_supported(const struct dc *dc) { + if (dc->res_pool == NULL) + return false; + return dc->res_pool->res_cap->num_dsc > 0; } |