|
@@ -597,10 +597,14 @@ static enum ice_status ice_init_check_adminq(struct ice_hw *hw)
|
|
|
return 0;
|
|
|
|
|
|
init_ctrlq_free_rq:
|
|
|
- ice_shutdown_rq(hw, cq);
|
|
|
- ice_shutdown_sq(hw, cq);
|
|
|
- mutex_destroy(&cq->sq_lock);
|
|
|
- mutex_destroy(&cq->rq_lock);
|
|
|
+ if (cq->rq.head) {
|
|
|
+ ice_shutdown_rq(hw, cq);
|
|
|
+ mutex_destroy(&cq->rq_lock);
|
|
|
+ }
|
|
|
+ if (cq->sq.head) {
|
|
|
+ ice_shutdown_sq(hw, cq);
|
|
|
+ mutex_destroy(&cq->sq_lock);
|
|
|
+ }
|
|
|
return status;
|
|
|
}
|
|
|
|
|
@@ -706,10 +710,14 @@ static void ice_shutdown_ctrlq(struct ice_hw *hw, enum ice_ctl_q q_type)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ice_shutdown_sq(hw, cq);
|
|
|
- ice_shutdown_rq(hw, cq);
|
|
|
- mutex_destroy(&cq->sq_lock);
|
|
|
- mutex_destroy(&cq->rq_lock);
|
|
|
+ if (cq->sq.head) {
|
|
|
+ ice_shutdown_sq(hw, cq);
|
|
|
+ mutex_destroy(&cq->sq_lock);
|
|
|
+ }
|
|
|
+ if (cq->rq.head) {
|
|
|
+ ice_shutdown_rq(hw, cq);
|
|
|
+ mutex_destroy(&cq->rq_lock);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|