]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnx2x: off by one in bnx2x_ets_e3b0_sp_pri_to_cos_set()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 17 Apr 2012 20:53:42 +0000 (20:53 +0000)
committerJoe Jin <joe.jin@oracle.com>
Tue, 28 Aug 2012 07:23:30 +0000 (15:23 +0800)
commit1879ca2f8f042e2c27c0f7e25901fe00bb350149
treecb579a47ae62e624a0864c3acbbbbeb7d59685de
parent6500fdcddccd1e63d719ad514f112be72881f5de
bnx2x: off by one in bnx2x_ets_e3b0_sp_pri_to_cos_set()

The sp_pri_to_cos[] array size depends on the config but lets say it is
BX_E3B0_MAX_NUM_COS_PORT0 and max_num_of_cos is also
DCBX_E3B0_MAX_NUM_COS_PORT0.  In the original code
"pri == max_num_of_cos" was accepted but it is one past the end of the
array.

Also we used "pri" before capping it.  It's a harmless read past the end
of the array, but it would affect which error message gets printed.

(cherry picked from commit 7e5998aa74065d3ab31d17e667f40ffebf4b8425)
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/bnx2x/bnx2x_link.c