aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1848-drm-amd-display-fix-incorrect-null-check-on-pointer.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1848-drm-amd-display-fix-incorrect-null-check-on-pointer.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1848-drm-amd-display-fix-incorrect-null-check-on-pointer.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1848-drm-amd-display-fix-incorrect-null-check-on-pointer.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1848-drm-amd-display-fix-incorrect-null-check-on-pointer.patch
new file mode 100644
index 00000000..30cc7475
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1848-drm-amd-display-fix-incorrect-null-check-on-pointer.patch
@@ -0,0 +1,35 @@
+From 60fa9adc6867554f5bae2ff66a27ddc2e095c6e6 Mon Sep 17 00:00:00 2001
+From: Colin Ian King <colin.king@canonical.com>
+Date: Fri, 26 Apr 2019 22:48:11 +0100
+Subject: [PATCH 1848/2940] drm/amd/display: fix incorrect null check on
+ pointer
+
+Currently an allocation is being made but the allocation failure
+check is being performed on another pointer. Fix this by checking
+the correct pointer. Also use the normal kernel idiom for null
+pointer checks.
+
+Addresses-Coverity: ("Resource leak")
+Fixes: 43e3ac8389ef ("drm/amd/display: Add function to copy DC streams")
+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_stream.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+index 6200df3edcd0..96e97d25d639 100644
+--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
++++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+@@ -168,7 +168,7 @@ struct dc_stream_state *dc_copy_stream(const struct dc_stream_state *stream)
+ struct dc_stream_state *new_stream;
+
+ new_stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
+- if (stream == NULL)
++ if (!new_stream)
+ return NULL;
+
+ memcpy(new_stream, stream, sizeof(struct dc_stream_state));
+--
+2.17.1
+