lib/ftl:fix scanbuild error in ftl_anm.c

Here we should consider about that ctrlr may be NULL,
so add assert here.

Change-Id: If4c8b2c6382ae6fdad541168d2e2b856fb5b8182
Signed-off-by: yidong0635 <dongx.yi@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454546
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
yidong0635 2019-05-15 09:33:51 -04:00 committed by Jim Harris
parent 84429e7bbb
commit 1c8efbdd51

View File

@ -402,7 +402,7 @@ ftl_anm_unregister_device(struct spdk_ftl_dev *dev)
pthread_mutex_lock(&g_anm.lock);
ctrlr = ftl_anm_find_ctrlr(&g_anm, dev->ctrlr);
assert(ctrlr != NULL);
pthread_mutex_lock(&ctrlr->lock);
LIST_FOREACH_SAFE(poller, &ctrlr->pollers, list_entry, temp_poller) {