]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ice: use [sr]q.count when checking if queue is initialized
authorJacob Keller <jacob.e.keller@intel.com>
Thu, 20 Sep 2018 00:23:04 +0000 (17:23 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 28 Sep 2018 18:16:36 +0000 (11:16 -0700)
commitc913b73cd05d8167433846eeb5b1d97dc820d7df
treed4e0d739a24b686522ac9e7082039788c6ff5931
parent5362700c942b2cc4bab328361545a6d6fe649534
ice: use [sr]q.count when checking if queue is initialized

When shutting down the controlqs, we check if they are initialized
before we shut them down and destroy the lock. This is important, as it
prevents attempts to access the lock of an already shutdown queue.

Unfortunately, we checked rq.head and sq.head as the value to determine
if the queue was initialized. This doesn't work, because head is not
reset when the queue is shutdown. In some flows, the adminq will have
already been shut down prior to calling ice_shutdown_all_ctrlqs. This
can result in a crash due to attempting to access the already destroyed
mutex.

Fix this by using rq.count and sq.count instead. Indeed, ice_shutdown_sq
and ice_shutdown_rq already indicate that this is the value we should be
using to determine of the queue was initialized.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_controlq.c