aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2683-drm-amd-display-small-cleanup-in-destruct.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2683-drm-amd-display-small-cleanup-in-destruct.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2683-drm-amd-display-small-cleanup-in-destruct.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2683-drm-amd-display-small-cleanup-in-destruct.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2683-drm-amd-display-small-cleanup-in-destruct.patch
new file mode 100644
index 00000000..c8d5bd60
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/2683-drm-amd-display-small-cleanup-in-destruct.patch
@@ -0,0 +1,42 @@
+From b88582ccd7892f5932c8fa02c89941f29069b051 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Mon, 6 Nov 2017 10:07:33 +0300
+Subject: [PATCH 2683/4131] drm/amd/display: small cleanup in destruct()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Static analysis tools get annoyed that we don't indent this if
+statement. Actually, the if statement isn't required because kfree()
+can handle NULL pointers just fine. The DCE110STRENC_FROM_STRENC()
+macro is a wrapper around container_of() but it's basically a no-op or a
+cast. Anyway, it's not really appropriate here so it should be removed
+as well.
+
+Acked-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
+index abb5434..84eec97 100644
+--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
++++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
+@@ -761,10 +761,8 @@ static void destruct(struct dcn10_resource_pool *pool)
+ }
+ }
+
+- for (i = 0; i < pool->base.stream_enc_count; i++) {
+- if (pool->base.stream_enc[i] != NULL)
+- kfree(DCE110STRENC_FROM_STRENC(pool->base.stream_enc[i]));
+- }
++ for (i = 0; i < pool->base.stream_enc_count; i++)
++ kfree(pool->base.stream_enc[i]);
+
+ for (i = 0; i < pool->base.audio_count; i++) {
+ if (pool->base.audios[i])
+--
+2.7.4
+