patch-2.2.11 linux/drivers/net/eql.c

Next file: linux/drivers/net/ewrk3.c
Previous file: linux/drivers/net/eepro100.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.10/linux/drivers/net/eql.c linux/drivers/net/eql.c
@@ -411,16 +411,15 @@
 	slaving_request_t srq;
 	int err;
 
-	err = verify_area(VERIFY_READ, (void *)srqp, sizeof (slaving_request_t));
+	err = copy_from_user(&srq, srqp, sizeof (slaving_request_t));
 	if (err)  
 	  {
 #ifdef EQL_DEBUG
 	if (eql_debug >= 20)
-		printk ("EQL enslave: error detected by verify_area\n");
+		printk ("EQL enslave: error detected by copy_from_user\n");
 #endif  
 		return err;
 	  }
-	copy_from_user (&srq, srqp, sizeof (slaving_request_t));
 
 #ifdef EQL_DEBUG
 	if (eql_debug >= 20)
@@ -473,11 +472,10 @@
 	slaving_request_t srq;
 	int err;
 
-	err = verify_area(VERIFY_READ, (void *)srqp, sizeof (slaving_request_t));
+	err = copy_from_user(&srq, srqp, sizeof (slaving_request_t));
 	if (err) 
 		return err;
 
-	copy_from_user (&srq, srqp, sizeof (slaving_request_t));
 #ifdef EQL_DEBUG
 	if (eql_debug >= 20)
 		printk ("%s: emancipate `%s`\n", dev->name, srq.slave_name);
@@ -504,11 +502,10 @@
 	slave_config_t sc;
 	int err;
 
-	err = verify_area(VERIFY_READ, (void *)scp, sizeof (slave_config_t));
+	err = copy_from_user (&sc, scp, sizeof (slave_config_t));
 	if (err) 
 		return err;
 
-	copy_from_user (&sc, scp, sizeof (slave_config_t));
 #ifdef EQL_DEBUG
 	if (eql_debug >= 20)
 		printk ("%s: get config for slave `%s'\n", dev->name, sc.slave_name);
@@ -541,7 +538,7 @@
 	slave_config_t sc;
 	int err;
 
-	err = verify_area(VERIFY_READ, (void *)scp, sizeof (slave_config_t));
+	err = copy_from_user (&sc, scp, sizeof (slave_config_t));
 	if (err) 
 		return err;
 
@@ -550,7 +547,6 @@
 		printk ("%s: set config for slave `%s'\n", dev->name, sc.slave_name);
 #endif
   
-	copy_from_user (&sc, scp, sizeof (slave_config_t));
 
 	eql = (equalizer_t *) dev->priv;
 	slave_dev = dev_get (sc.slave_name);
@@ -583,13 +579,12 @@
 	if ( eql_is_master (dev) )
 	{
 		int err;
-		err = verify_area(VERIFY_WRITE, (void *)mcp, sizeof (master_config_t));
-		if (err) 
-			return err;
 		eql = (equalizer_t *) dev->priv;
 		mc.max_slaves = eql->max_slaves;
 		mc.min_slaves = eql->min_slaves;
-		copy_to_user (mcp, &mc, sizeof (master_config_t));
+		err = copy_to_user (mcp, &mc, sizeof (master_config_t));
+		if (err) 
+			return err;
 		return 0;
 	}
 	return -EINVAL;
@@ -602,14 +597,13 @@
 	master_config_t mc;
 	int err;
 
-	err = verify_area(VERIFY_READ, (void *)mcp, sizeof (master_config_t));
+	err = copy_from_user (&mc, mcp, sizeof (master_config_t));
 	if (err)
 		return err;
 #if EQL_DEBUG
 	if (eql_debug >= 20)
 		printk ("%s: set master config\n", dev->name);
 #endif
-	copy_from_user (&mc, mcp, sizeof (master_config_t));
 	if ( eql_is_master (dev) )
 	{
 		eql = (equalizer_t *) dev->priv;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)