diff options
Diffstat (limited to 'kernel/compat.c')
-rw-r--r-- | kernel/compat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/compat.c b/kernel/compat.c index 24f00610c575..333d364be29d 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -912,7 +912,8 @@ long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask, | |||
912 | * bitmap. We must however ensure the end of the | 912 | * bitmap. We must however ensure the end of the |
913 | * kernel bitmap is zeroed. | 913 | * kernel bitmap is zeroed. |
914 | */ | 914 | */ |
915 | if (nr_compat_longs-- > 0) { | 915 | if (nr_compat_longs) { |
916 | nr_compat_longs--; | ||
916 | if (__get_user(um, umask)) | 917 | if (__get_user(um, umask)) |
917 | return -EFAULT; | 918 | return -EFAULT; |
918 | } else { | 919 | } else { |
@@ -954,7 +955,8 @@ long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, | |||
954 | * We dont want to write past the end of the userspace | 955 | * We dont want to write past the end of the userspace |
955 | * bitmap. | 956 | * bitmap. |
956 | */ | 957 | */ |
957 | if (nr_compat_longs-- > 0) { | 958 | if (nr_compat_longs) { |
959 | nr_compat_longs--; | ||
958 | if (__put_user(um, umask)) | 960 | if (__put_user(um, umask)) |
959 | return -EFAULT; | 961 | return -EFAULT; |
960 | } | 962 | } |