msm: mdss: fix the input layer and layer list array index

In the current implementation, wrong memory is being referenced while
copying to user. Correct the input layer and layer list array index
to avoid invalid memory access.

CRs-Fixed: 882379
Change-Id: I47790d1c5419c099ce32727c28e5e6e7e742f18f
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
This commit is contained in:
Jeevan Shriram 2015-08-06 16:06:13 -07:00 committed by David Keitel
parent 07c71c6ce4
commit 2a6a83e5be

View file

@ -3919,8 +3919,8 @@ static int mdss_fb_atomic_commit_ioctl(struct fb_info *info,
if (layer_count) { if (layer_count) {
for (j = 0; j < layer_count; j++) { for (j = 0; j < layer_count; j++) {
rc = copy_to_user(&input_layer_list[i].error_code, rc = copy_to_user(&input_layer_list[j].error_code,
&layer_list[i].error_code, sizeof(int)); &layer_list[j].error_code, sizeof(int));
if (rc) if (rc)
pr_err("layer error code copy to user failed\n"); pr_err("layer error code copy to user failed\n");
} }