summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-07-02 07:13:43 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-07-02 07:13:43 -0700
commit7e4d8780224c17e630b8e0538d1da84b5da14b14 (patch)
treef1d81ac36c56f2cb2765a17752db5432c67f8d7b /drivers/gpu
parent79a8f215703e1400e53abea8f6028593210f4ece (diff)
parent5e073ffd6668d78fc9b6073511c99b974b4fcf7c (diff)
Merge "drm/msm/dsi-staging: Add range check in debugfs_dump_info_read"
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/dsi-staging/dsi_display.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c
index 742760cc791c..8e25260d21c0 100644
--- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c
+++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -98,6 +98,9 @@ static ssize_t debugfs_dump_info_read(struct file *file,
"\tClock master = %s\n",
display->ctrl[display->clk_master_idx].ctrl->name);
+ if (len > count)
+ len = count;
+
if (copy_to_user(buff, buf, len)) {
kfree(buf);
return -EFAULT;