]> git.baikalelectronics.ru Git - kernel.git/commit
cnic: Fix crash in cnic_bnx2x_service_kcq()
authorMichael Chan <mchan@broadcom.com>
Wed, 18 Sep 2013 08:50:39 +0000 (01:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 18 Sep 2013 16:24:32 +0000 (12:24 -0400)
commit0bdd81b44adfc6a888decffd79e77496d6d46c19
treeca54f6013fa114b6d70e685be3d003d8aef0af53
parent98848e1563b8bbc71dee64be79009961e97cf5ef
cnic: Fix crash in cnic_bnx2x_service_kcq()

commit f6072305af3520f940a69a36aebdfcdabafbfda4
    cnic: Use CHIP_NUM macros from bnx2x.h

changed the code to use the bnx2x macro NO_FCOE() to determine if FCoE
is supported or not.  There is another place in cnic that is still using
the old method to determine if FCoE is supported or not.  The 2 methods
may not yield the same result after the network interface is brought down
and up.  This will cause the crash as cnic_bnx2x_service_kcq() will access
the uninitialized cp->kcq2.

The fix is to consistently use the same macro CNIC_SUPPORTS_FCOE() which
uses the bnx2x NO_FCOE() macro.  As a follow-up, we can clean up the code
to remove the old method as it is no longer needed.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/cnic.c