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, 30 Dec 2008 19:32:56 +0000 (11:32 -0800)
datapath/datapath.c

index dbd0628d1bd0e17776779a92d0af582cf5e9a186..2677445fe924a990553f09f8ffb453ed481897f0 100644 (file)
@@ -1127,7 +1127,7 @@ static struct genl_ops dp_genl_ops_add_dp = {
 
 struct datapath *dp_get_by_idx(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]);
 }