]> git.baikalelectronics.ru Git - kernel.git/commit
be2net: Avoid accessing eq object in be_msix_register routine, when i < 0.
authorVenkat Duvvuru <venkatkumar.duvvuru@avagotech.com>
Thu, 17 Dec 2015 20:10:50 +0000 (01:40 +0530)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Dec 2015 20:50:52 +0000 (15:50 -0500)
commit991ed6f3b1c7522428640d5afb43d91946f45373
tree048a86e6d1c078c8eda7e43b4e5453b035397f90
parentafc4b9dcff8e8c953125910ff8bf5ee7ae41a5b8
be2net: Avoid accessing eq object in be_msix_register routine, when i < 0.

When the first request_irq fails in be_msix_register, i value
would be zero. The current code decrements the i value and
accesses the eq object without validating the decremented
"i" value. This can cause an "invalid memory address access"
violation.

This patch fixes the problem by accessing the eq object after
validating the "i" value.

Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@avagotech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/emulex/benet/be_main.c