Patch "drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-amd-display-guard-against-null-pointer-deref-whe.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e0ddc22b561dcf20c0a78e3a1c4a67d0d47c29ec
Author: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx>
Date:   Fri Dec 18 12:14:00 2020 -0500

    drm/amd/display: Guard against NULL pointer deref when get_i2c_info fails
    
    [ Upstream commit 44a09e3d95bd2b7b0c224100f78f335859c4e193 ]
    
    [Why]
    If the BIOS table is invalid or corrupt then get_i2c_info can fail
    and we dereference a NULL pointer.
    
    [How]
    Check that ddc_pin is not NULL before using it and log an error if it
    is because this is unexpected.
    
    Tested-by: Daniel Wheeler <daniel.wheeler@xxxxxxx>
    Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@xxxxxxx>
    Reviewed-by: Eric Yang <eric.yang2@xxxxxxx>
    Acked-by: Anson Jacob <anson.jacob@xxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index fa0e6c8e2447..e3bedf4cc9c0 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1124,6 +1124,11 @@ static bool construct(
 		goto ddc_create_fail;
 	}
 
+	if (!link->ddc->ddc_pin) {
+		DC_ERROR("Failed to get I2C info for connector!\n");
+		goto ddc_create_fail;
+	}
+
 	link->ddc_hw_inst =
 		dal_ddc_get_line(
 			dal_ddc_service_get_ddc_pin(link->ddc));



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux