summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-06 14:24:16 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-06 14:24:15 -0700
commit01ecd15b9d998f906418e7fd7ac22c796b250e7a (patch)
treee67921878acfe39dfb5e376fcad78c66852fdb22
parent980599904f0e98e45d6cfe7f5d0f28f4550c9407 (diff)
parentad8e758d30164290a71d9c59fbf7854029556a3e (diff)
Merge "msm: mdss: fix memcpy source and dest memory buffer size mismatch"
-rw-r--r--drivers/video/fbdev/msm/mdss_compat_utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/video/fbdev/msm/mdss_compat_utils.c b/drivers/video/fbdev/msm/mdss_compat_utils.c
index 64e737f9e01f..2b9c71441d68 100644
--- a/drivers/video/fbdev/msm/mdss_compat_utils.c
+++ b/drivers/video/fbdev/msm/mdss_compat_utils.c
@@ -119,6 +119,9 @@ static unsigned int __do_compat_ioctl_nr(unsigned int cmd32)
static void __copy_atomic_commit_struct(struct mdp_layer_commit *commit,
struct mdp_layer_commit32 *commit32)
{
+ unsigned int destSize = sizeof(commit->commit_v1.reserved);
+ unsigned int srcSize = sizeof(commit32->commit_v1.reserved);
+ unsigned int count = (destSize <= srcSize ? destSize : srcSize);
commit->version = commit32->version;
commit->commit_v1.flags = commit32->commit_v1.flags;
commit->commit_v1.input_layer_cnt =
@@ -127,7 +130,7 @@ static void __copy_atomic_commit_struct(struct mdp_layer_commit *commit,
commit->commit_v1.right_roi = commit32->commit_v1.right_roi;
commit->commit_v1.bl_level = commit32->commit_v1.bl_level;
memcpy(&commit->commit_v1.reserved, &commit32->commit_v1.reserved,
- sizeof(commit32->commit_v1.reserved));
+ count);
}
static struct mdp_input_layer32 *__create_layer_list32(