Skip to contentSkip to conversation

pktgen: Fix unsigned function that is returning negative vals

PATCH Applied Paul Gortmaker 2 participants 2 messages Jan 20, 2012 – Jan 22, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

net/core/pktgen.c +2 -2
index 65f80c7..4d8ce93 100644
@@ -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;
Signature · 1 line
1.7.7.2
maintainer Applied
#1 lore raw

From: Paul Gortmaker <[email protected]>
Date: Thu, 19 Jan 2012 20:40:06 -0500

Quoted 6 lines

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.

Applied.