[ovs-dev] [PATCH 1/3] datapath: When adding a port, return the new port number to userspace.

Ben Pfaff blp at nicira.com
Wed Feb 10 16:55:02 PST 2010


'port' is a kernel-space copy of the odp_port and modifying it is useless.
'portp' is the userspace copy; modifying it is useful.

None of our current userspace users care about the port number and so we
never noticed.

Found by sparse (http://sparse.wiki.kernel.org/).
---
 datapath/datapath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/datapath/datapath.c b/datapath/datapath.c
index ba363fb..94f3196 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -422,7 +422,7 @@ got_port_no:
 
 	dp_sysfs_add_if(dp->ports[port_no]);
 
-	err = __put_user(port_no, &port.port);
+	err = __put_user(port_no, &portp->port);
 
 out_put:
 	dev_put(dev);
-- 
1.6.6.1





More information about the dev mailing list