]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Check engine is not NULL before acquiring
authorAric Cyr <aric.cyr@amd.com>
Wed, 22 Jan 2020 03:50:13 +0000 (22:50 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 11 Feb 2020 20:07:03 +0000 (15:07 -0500)
[Why]
Engine can be NULL in some cases, so we must not acquire it.

[How]
Check for NULL engine before acquiring.

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c

index f1a5d2c6aa37874577fa6e804cad2c5a43b8c6b8..68c4049cbc2adaedd986f91e8951b8ad491208f3 100644 (file)
@@ -400,7 +400,7 @@ static bool acquire(
 {
        enum gpio_result result;
 
-       if (!is_engine_available(engine))
+       if ((engine == NULL) || !is_engine_available(engine))
                return false;
 
        result = dal_ddc_open(ddc, GPIO_MODE_HARDWARE,