From: Paul Gortmaker Date: Thu, 19 Jan 2012 15:40:06 +0000 (+0000) Subject: pktgen: Fix unsigned function that is returning negative vals X-Git-Tag: v3.3-rc2~37^2~29 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bf0813bd282f6ded0a5efca3db238287f7a3dbe8;p=karo-tx-linux.git pktgen: Fix unsigned function that is returning negative vals Every call to num_args() immediately checks the return value for less than zero, as it will return -EFAULT for a failed get_user() call. So it makes no sense for the function to be declared as an unsigned long. Signed-off-by: Paul Gortmaker Signed-off-by: David S. Miller --- diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 65f80c7b1656..4d8ce93cd503 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -767,8 +767,8 @@ done: return i; } -static unsigned long num_arg(const char __user * user_buffer, - unsigned long maxlen, unsigned long *num) +static long num_arg(const char __user *user_buffer, unsigned long maxlen, + unsigned long *num) { int i; *num = 0;