From 1c8efbdd512223c7ab77fa9a02de00f8e1b25ac5 Mon Sep 17 00:00:00 2001 From: yidong0635 Date: Wed, 15 May 2019 09:33:51 -0400 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/454546 Tested-by: SPDK CI Jenkins Reviewed-by: Konrad Sztyber Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Reviewed-by: Jim Harris --- lib/ftl/ftl_anm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ftl/ftl_anm.c b/lib/ftl/ftl_anm.c index 58b6fe7455..50311ffc2c 100644 --- a/lib/ftl/ftl_anm.c +++ b/lib/ftl/ftl_anm.c @@ -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) {