Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Paul Gortmaker and committed by
David S. Miller
bf0813bd 974c1236

+2 -2
+2 -2
net/core/pktgen.c
··· 767 767 return i; 768 768 } 769 769 770 - static unsigned long num_arg(const char __user * user_buffer, 771 - unsigned long maxlen, unsigned long *num) 770 + static long num_arg(const char __user *user_buffer, unsigned long maxlen, 771 + unsigned long *num) 772 772 { 773 773 int i; 774 774 *num = 0;