diff options
| -rw-r--r-- | drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index ea789376de0f..45de21c210c1 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | |||
| @@ -1795,6 +1795,7 @@ vchiq_compat_ioctl_await_completion(struct file *file, | |||
| 1795 | struct vchiq_await_completion32 args32; | 1795 | struct vchiq_await_completion32 args32; |
| 1796 | struct vchiq_completion_data32 completion32; | 1796 | struct vchiq_completion_data32 completion32; |
| 1797 | unsigned int *msgbufcount32; | 1797 | unsigned int *msgbufcount32; |
| 1798 | unsigned int msgbufcount_native; | ||
| 1798 | compat_uptr_t msgbuf32; | 1799 | compat_uptr_t msgbuf32; |
| 1799 | void *msgbuf; | 1800 | void *msgbuf; |
| 1800 | void **msgbufptr; | 1801 | void **msgbufptr; |
| @@ -1906,7 +1907,11 @@ vchiq_compat_ioctl_await_completion(struct file *file, | |||
| 1906 | sizeof(completion32))) | 1907 | sizeof(completion32))) |
| 1907 | return -EFAULT; | 1908 | return -EFAULT; |
| 1908 | 1909 | ||
| 1909 | args32.msgbufcount--; | 1910 | if (get_user(msgbufcount_native, &args->msgbufcount)) |
| 1911 | return -EFAULT; | ||
| 1912 | |||
| 1913 | if (!msgbufcount_native) | ||
| 1914 | args32.msgbufcount--; | ||
| 1910 | 1915 | ||
| 1911 | msgbufcount32 = | 1916 | msgbufcount32 = |
| 1912 | &((struct vchiq_await_completion32 __user *)arg)->msgbufcount; | 1917 | &((struct vchiq_await_completion32 __user *)arg)->msgbufcount; |
