From: Michael Chan Date: Wed, 27 Jun 2012 15:08:19 +0000 (+0000) Subject: cnic: Fix occasional NULL pointer dereference during reboot. X-Git-Tag: v3.6-rc1~125^2~377 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2028b2376a858cb68a7fcc129f6508f59b45381;p=pandora-kernel.git cnic: Fix occasional NULL pointer dereference during reboot. We register with bnx2x before we allocate ctx_tbl structure, so it is possible for bnx2x to call cnic_ctl before the structure is allocated. This can sometimes cause NULL pointer dereference of cp->ctx_tbl. We fix this by adding simple checking for valid state before proceeding. The cnic_ctl call is RCU protected so we don't have to deal with race conditions. Because of the additional checking, we need to finish the shutdown before clearing the CNIC_UP flag. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- Reading git-diff-tree failed