OSDN Git Service

ice: Clean control queues only when they are initialized
authorPreethi Banala <preethi.banala@intel.com>
Thu, 9 Aug 2018 13:28:55 +0000 (06:28 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 23 Aug 2018 16:51:44 +0000 (09:51 -0700)
commitb29bc220e2c7bd494a4605defcd93b18d5a8cf86
tree5de1d2dc249a68935f6688a1c00970d1139f98cd
parentf8ba7db850350319348b6d3c276f8ba19bc098ef
ice: Clean control queues only when they are initialized

Clean control queues only when they are initialized. One of the ways to
validate if the basic initialization is done is by checking value of
cq->sq.head and cq->rq.head variables that specify the register address.
This patch adds a check to avoid NULL pointer dereference crash when tried
to shutdown uninitialized control queue.

Signed-off-by: Preethi Banala <preethi.banala@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_controlq.c