aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/4724-drm-amd-display-fix-type-of-variable.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/4724-drm-amd-display-fix-type-of-variable.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.14.71/4724-drm-amd-display-fix-type-of-variable.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/4724-drm-amd-display-fix-type-of-variable.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/4724-drm-amd-display-fix-type-of-variable.patch
new file mode 100644
index 00000000..891074c2
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/4724-drm-amd-display-fix-type-of-variable.patch
@@ -0,0 +1,38 @@
+From 8933217efba2a57654d8f2d3763f4fc7884f3e4d Mon Sep 17 00:00:00 2001
+From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
+Date: Fri, 15 Jun 2018 08:32:28 -0500
+Subject: [PATCH 4724/5725] drm/amd/display: fix type of variable
+
+Currently, the maximum value that *counter* can reach is 255, and
+code at line 150: while (counter < 1000) { implies a bigger value
+could be expected.
+
+Fix this by changing the type of variable *counter* from uint8_t
+to uint16_t.
+
+Addresses-Coverity-ID: 1470030 ("Operands don't affect result")
+Fixes: 2b6199a1d1b7 ("drm/amd/display: replace msleep with udelay in fbc path")
+Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Cc: stable@vger.kernel.org
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
+index a79fc0b..df02701 100644
+--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
++++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c
+@@ -143,7 +143,7 @@ static void wait_for_fbc_state_changed(
+ struct dce110_compressor *cp110,
+ bool enabled)
+ {
+- uint8_t counter = 0;
++ uint16_t counter = 0;
+ uint32_t addr = mmFBC_STATUS;
+ uint32_t value;
+
+--
+2.7.4
+