From eb84a1133f679b55d40bba2eb80b71af6bb4a577 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Thu, 18 Jul 2019 07:08:41 -0400 Subject: [PATCH] lib/ftl: assert write pointer from band This is just assert to assure the Klocwork static analizer that wptr is not NULL. Change-Id: I003620431afb8497a57c50af8480c34ec3fac6d6 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462489 Reviewed-by: Konrad Sztyber Reviewed-by: Darek Stojaczyk Reviewed-by: Wojciech Malikowski Reviewed-by: Ben Walker Tested-by: SPDK CI Jenkins --- lib/ftl/ftl_core.c | 1 + lib/ftl/ftl_restore.c | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/ftl/ftl_core.c b/lib/ftl/ftl_core.c index 7e578fd6b..c1ff799d8 100644 --- a/lib/ftl/ftl_core.c +++ b/lib/ftl/ftl_core.c @@ -211,6 +211,7 @@ ftl_wptr_from_band(struct ftl_band *band) } } + assert(false); return NULL; } diff --git a/lib/ftl/ftl_restore.c b/lib/ftl/ftl_restore.c index dfc04f091..393d16e62 100644 --- a/lib/ftl/ftl_restore.c +++ b/lib/ftl/ftl_restore.c @@ -1273,5 +1273,6 @@ ftl_restore_device(struct ftl_restore *restore, ftl_restore_fn cb) /* If restore_device is called, there must be at least one valid band */ rband = ftl_restore_next_band(restore); + assert(rband); return ftl_restore_tail_md(rband); }