aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-02-07 15:35:42 +1100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-02 09:53:09 -0700
commiteaadbfbf85875c76259c93e7ba51aebe2cad2138 (patch)
tree0fc40c720395b73aed1a946edf67764c434b360b /fs/lockd
parent9b5796b841ae7be468c39e88a9c723269651f57c (diff)
downloadkernel_samsung_smdk4412-eaadbfbf85875c76259c93e7ba51aebe2cad2138.zip
kernel_samsung_smdk4412-eaadbfbf85875c76259c93e7ba51aebe2cad2138.tar.gz
kernel_samsung_smdk4412-eaadbfbf85875c76259c93e7ba51aebe2cad2138.tar.bz2
lockd: fix arg parsing for grace_period and timeout.
commit de5b8e8e047534aac6bc9803f96e7257436aef9c upstream. If you try to set grace_period or timeout via a module parameter to lockd, and do this on a big-endian machine where sizeof(int) != sizeof(unsigned long) it won't work. This number given will be effectively shifted right by the difference in those two sizes. So cast kp->arg properly to get correct result. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/svc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index c061b9a..2444780 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -440,7 +440,7 @@ static int param_set_##name(const char *val, struct kernel_param *kp) \
__typeof__(type) num = which_strtol(val, &endp, 0); \
if (endp == val || *endp || num < (min) || num > (max)) \
return -EINVAL; \
- *((int *) kp->arg) = num; \
+ *((type *) kp->arg) = num; \
return 0; \
}