From 93b8eab4d754d7aef2b90f28cd99ddc275279008 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 30 Dec 2008 10:48:59 -0800 Subject: [PATCH] Fix off-by-one error in looking up datapaths by index. --- datapath/datapath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapath/datapath.c b/datapath/datapath.c index dbd0628d..2677445f 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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]); } -- 2.30.2