diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2018-04-04 11:24:25 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2018-04-04 11:24:24 -0700 |
| commit | 8fd574794db60352ed8009b76128694d86b438c7 (patch) | |
| tree | 7fe3f7873ebf2799551feb3f18f46392d531b319 | |
| parent | 7405e11851da69bb4f4773036090948008e575cd (diff) | |
| parent | a9c93223f4faf3eeaaa25b813a1fdee41aba806e (diff) | |
Merge "msm: mdss: Fix for wrong length in copy_to_user"
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_dsi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c index 7b6153503af5..0d41f41371dd 100644 --- a/drivers/video/fbdev/msm/mdss_dsi.c +++ b/drivers/video/fbdev/msm/mdss_dsi.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2018, 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 @@ -760,7 +760,7 @@ static ssize_t mdss_dsi_cmd_state_read(struct file *file, char __user *buf, if (blen < 0) return 0; - if (copy_to_user(buf, buffer, blen)) + if (copy_to_user(buf, buffer, min(count, (size_t)blen+1))) return -EFAULT; *ppos += blen; |
