diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3111-drm-amd-display-fix-a-missing-null-check-on-a-failed.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3111-drm-amd-display-fix-a-missing-null-check-on-a-failed.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3111-drm-amd-display-fix-a-missing-null-check-on-a-failed.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3111-drm-amd-display-fix-a-missing-null-check-on-a-failed.patch new file mode 100644 index 00000000..e6da9b89 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/3111-drm-amd-display-fix-a-missing-null-check-on-a-failed.patch @@ -0,0 +1,34 @@ +From d059da84f0dee9afb90dd6b5f6c41611ac480c23 Mon Sep 17 00:00:00 2001 +From: Colin Ian King <colin.king@canonical.com> +Date: Tue, 23 Jul 2019 15:23:12 +0100 +Subject: [PATCH 3111/4256] drm/amd/display: fix a missing null check on a + failed kzalloc + +Currently the allocation of config may fail and a null pointer +dereference on config can occur. Fix this by added a null +check on a failed allocation of config. + +Addresses-Coverity: ("Dereference null return") +Fixes: c2cd9d04ecf0 ("drm/amd/display: Hook up calls to do stereo mux and dig programming to stereo control interface") +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/core/dc.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c +index ecf562e386cb..bc48e8e6ce4d 100644 +--- a/drivers/gpu/drm/amd/display/dc/core/dc.c ++++ b/drivers/gpu/drm/amd/display/dc/core/dc.c +@@ -1269,6 +1269,8 @@ bool dc_set_generic_gpio_for_stereo(bool enable, + struct gpio_generic_mux_config *config = kzalloc(sizeof(struct gpio_generic_mux_config), + GFP_KERNEL); + ++ if (!config) ++ return false; + pin_info = dal_gpio_get_generic_pin_info(gpio_service, GPIO_ID_GENERIC, 0); + + if (pin_info.mask == 0xFFFFFFFF || pin_info.offset == 0xFFFFFFFF) { +-- +2.17.1 + |