net/mlx4_core: Fix access to uninitialized index
authorTariq Toukan <tariqt@mellanox.com>
Sun, 15 May 2016 07:21:26 +0000 (10:21 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 22 Aug 2016 21:37:10 +0000 (22:37 +0100)
commit150130396177f7dabe7f3fdd18f64fe19adbced7
tree1fcb242da47184173bbc30bbb27353c99816a6a6
parent2d1bbf04a6f305528e4c1e5782134b6bbb9cc4b2
net/mlx4_core: Fix access to uninitialized index

commit 2bb07e155bb3e0c722c806723f737cf8020961ef upstream.

Prevent using uninitialized or negative index when handling
steering entries.

Fixes: b12d93d63c32 ('mlx4: Add support for promiscuous mode in the new steering model.')
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/mellanox/mlx4/mcg.c