Commit bf0813bd282f6ded0a5efca3db238287f7a3dbe8
Committed by
David S. Miller
1 parent
974c12360d
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
net/core/pktgen.c
... | ... | @@ -767,8 +767,8 @@ |
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; |