nvme/ctrlr: Fix the invalid access of free_io_qids array.
To fix the segment fault. Fixes issue #1749 Reported by user: https://github.com/rdxsasha Signed-off-by: Ziye Yang <ziye.yang@intel.com> Change-Id: I130d8dba04e4a3e83c22c5967507c1297a048f0b Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8813 Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
111851efbb
commit
03323b09a4
@ -4436,6 +4436,10 @@ spdk_nvme_ctrlr_free_qid(struct spdk_nvme_ctrlr *ctrlr, uint16_t qid)
|
|||||||
assert(qid <= ctrlr->opts.num_io_queues);
|
assert(qid <= ctrlr->opts.num_io_queues);
|
||||||
|
|
||||||
nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
nvme_robust_mutex_lock(&ctrlr->ctrlr_lock);
|
||||||
spdk_bit_array_set(ctrlr->free_io_qids, qid);
|
|
||||||
|
if (spdk_likely(ctrlr->free_io_qids)) {
|
||||||
|
spdk_bit_array_set(ctrlr->free_io_qids, qid);
|
||||||
|
}
|
||||||
|
|
||||||
nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock);
|
nvme_robust_mutex_unlock(&ctrlr->ctrlr_lock);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user