summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-10-30 00:08:05 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-10-30 00:08:06 -0700
commit2eab6d5e0752c61898704103fc9d27720696abee (patch)
treeb934dff6516f9685e14841693888389bf2c2e91a
parente42757fc730430938dfe990125da9e417cfa11e6 (diff)
parenteb4b0ca0f8dc19248b5bab8c7dcab7382522641c (diff)
Merge "drm/msm/hdmi-staging: Fix Buffer Overflow" into kernel.lnx.4.4.r38-rel
-rw-r--r--drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c
index 5a9e56b58158..d755ba959c20 100644
--- a/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c
+++ b/drivers/gpu/drm/msm/hdmi-staging/sde_hdmi.c
@@ -78,7 +78,12 @@ static ssize_t _sde_hdmi_debugfs_dump_info_read(struct file *file,
if (!buf)
return -ENOMEM;
- len += snprintf(buf, SZ_4K, "name = %s\n", display->name);
+ len += snprintf(buf, SZ_1K, "name = %s\n", display->name);
+
+ if (len > count) {
+ kfree(buf);
+ return -ENOMEM;
+ }
if (copy_to_user(buff, buf, len)) {
kfree(buf);