Skip to content

Commit

Permalink
msm: mdss: compat: avoid overrwriting err code from ioctl
Browse files Browse the repository at this point in the history
When PREPARE OVERLAY ioctl returns an error code to indicate
reason for failure, the compat layer must not overwrite this error
code with those from compat functions. Userspace processes calling
overlay ioctls rely on error code from driver ioctls, not the error codes
from compat functions for some use cases Ex: falling back to mixed mode
composition on -E2BIG.
Fix this by propagating appropriate error code on failure.

Change-Id: Ib238437be58731724a445f90183511011a6e612c
Signed-off-by: Manoj Rao <manojraj@codeaurora.org>
  • Loading branch information
Manoj Rao committed Apr 21, 2014
1 parent 6791a1b commit 29acad3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/video/msm/mdss/mdss_compat_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2513,8 +2513,9 @@ int mdss_compat_overlay_ioctl(struct fb_info *info, unsigned int cmd,
} else {
ret = mdss_fb_do_ioctl(info, cmd,
(unsigned long) ovlist);
ret = __to_user_mdp_overlaylist(ovlist32, ovlist,
layers_head);
if (!ret)
ret = __to_user_mdp_overlaylist(ovlist32,
ovlist, layers_head);
}
break;
case MSMFB_OVERLAY_UNSET:
Expand Down

0 comments on commit 29acad3

Please sign in to comment.