summaryrefslogtreecommitdiffstats
path: root/kernel/compat.c
diff options
context:
space:
mode:
authorDavid S. Miller2015-06-09 05:06:56 +0200
committerDavid S. Miller2015-06-09 05:06:56 +0200
commit941742f49762ba4c908510f036b09a46c1b14513 (patch)
treeaafb7a72c2072f98889406668003234bed56df02 /kernel/compat.c
parentnet: phy: dp83867: Fix device tree entries (diff)
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net (diff)
downloadkernel-qcow2-linux-941742f49762ba4c908510f036b09a46c1b14513.tar.gz
kernel-qcow2-linux-941742f49762ba4c908510f036b09a46c1b14513.tar.xz
kernel-qcow2-linux-941742f49762ba4c908510f036b09a46c1b14513.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'kernel/compat.c')
-rw-r--r--kernel/compat.c6
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,
* bitmap. We must however ensure the end of the
* kernel bitmap is zeroed.
*/
- if (nr_compat_longs-- > 0) {
+ if (nr_compat_longs) {
+ nr_compat_longs--;
if (__get_user(um, umask))
return -EFAULT;
} else {
@@ -954,7 +955,8 @@ long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
* We dont want to write past the end of the userspace
* bitmap.
*/
- if (nr_compat_longs-- > 0) {
+ if (nr_compat_longs) {
+ nr_compat_longs--;
if (__put_user(um, umask))
return -EFAULT;
}