summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-07-10 20:33:36 +0000
committerDavid S. Miller <davem@davemloft.net>2012-07-16 22:57:43 -0700
commit447458c01f4c765ab37ac7b380e60d977daae4c5 (patch)
treee827aadcb288c97970e1f864a49cc9b389acaf2a
parentf0396f60d7c165018c9b203fb9b89fb224835578 (diff)
downloadlinux-447458c01f4c765ab37ac7b380e60d977daae4c5.tar.bz2
net/mlx4: off by one in parse_trans_rule()
This should be ">=" here instead of ">". MLX4_NET_TRANS_RULE_NUM is 6. We use "spec->id" as an array offset into the __rule_hw_sz[] and __sw_id_hw[] arrays which have 6 elements. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Hadar Hen Zion <hadarh@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mcg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index bc62f536ffae..5bac0dfafbd8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -773,7 +773,7 @@ static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec,
[MLX4_NET_TRANS_RULE_ID_UDP] =
sizeof(struct mlx4_net_trans_rule_hw_tcp_udp)
};
- if (spec->id > MLX4_NET_TRANS_RULE_NUM) {
+ if (spec->id >= MLX4_NET_TRANS_RULE_NUM) {
mlx4_err(dev, "Invalid network rule id. id = %d\n", spec->id);
return -EINVAL;
}