summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-11-05 08:04:21 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-11-05 08:04:21 -0800
commitd847b96c753f977edad32fe7dac844cbac2b8607 (patch)
treed2264711c33e5cfecd9ecf176636889bffcf9b2b /drivers/gpu
parent95001d5135bf824010611012e146c37e5c448958 (diff)
parent13d43fca0c03920648028fd560fb9e575c8f878d (diff)
Merge "drm/msm/hdmi-staging: Fix Buffer Overflow"
Diffstat (limited to 'drivers/gpu')
-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);