aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3556-drm-amd-display-fix-a-potential-null-pointer-derefer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3556-drm-amd-display-fix-a-potential-null-pointer-derefer.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3556-drm-amd-display-fix-a-potential-null-pointer-derefer.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3556-drm-amd-display-fix-a-potential-null-pointer-derefer.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3556-drm-amd-display-fix-a-potential-null-pointer-derefer.patch
new file mode 100644
index 00000000..dcbfaa00
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3556-drm-amd-display-fix-a-potential-null-pointer-derefer.patch
@@ -0,0 +1,44 @@
+From 77fb10b27547ff1f7bc5800011f01aca541339e4 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Fri, 16 Aug 2019 23:10:11 +0100
+Subject: [PATCH 3556/4256] drm/amd/display: fix a potential null pointer
+ dereference
+
+Currently the pointer init_data is dereferenced on the assignment
+of fw_info before init_data is sanity checked to see if it is null.
+Fix te potential null pointer dereference on init_data by only
+performing dereference after it is null checked.
+
+Addresses-Coverity: ("Dereference before null check")
+Fixes: 9adc8050bf3c ("drm/amd/display: make firmware info only load once during dc_bios create")
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Colin Ian King <colin.king@canonical.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c
+index 990481b35682..5933a704847e 100644
+--- a/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c
++++ b/drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c
+@@ -1233,7 +1233,7 @@ static bool calc_pll_max_vco_construct(
+ struct calc_pll_clock_source_init_data *init_data)
+ {
+ uint32_t i;
+- struct dc_firmware_info *fw_info = &init_data->bp->fw_info;
++ struct dc_firmware_info *fw_info;
+ if (calc_pll_cs == NULL ||
+ init_data == NULL ||
+ init_data->bp == NULL)
+@@ -1242,6 +1242,7 @@ static bool calc_pll_max_vco_construct(
+ if (init_data->bp->fw_info_valid)
+ return false;
+
++ fw_info = &init_data->bp->fw_info;
+ calc_pll_cs->ctx = init_data->ctx;
+ calc_pll_cs->ref_freq_khz = fw_info->pll_info.crystal_frequency;
+ calc_pll_cs->min_vco_khz =
+--
+2.17.1
+