Fix off-by-one error in looking up datapaths by index.
authorBen Pfaff <blp@nicira.com>
Tue, 30 Dec 2008 18:48:59 +0000 (10:48 -0800)
committerBen Pfaff <blp@nicira.com>
Tue, 13 Jan 2009 01:11:30 +0000 (17:11 -0800)
datapath/datapath.c

index baf1d40..9d0cea7 100644 (file)
@@ -1125,7 +1125,7 @@ static struct genl_ops dp_genl_ops_add_dp = {
 
 struct datapath *dp_get(int dp_idx)
 {
-       if (dp_idx < 0 || dp_idx > DP_MAX)
+       if (dp_idx < 0 || dp_idx >= DP_MAX)
                return NULL;
        return rcu_dereference(dps[dp_idx]);
 }