From 37acf6814bb9288db148f95df02fad6da3c51b0f Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Thu, 18 Jul 2019 07:32:13 -0400 Subject: [PATCH] lib/ftl: assert that chunk is never NULL Code on line 613 should never be reached for last chunk on the band, since it is checked on line 606. This assert verifies that, all chunks before last are not NULL. Change-Id: I78a9967f91c0873981b3308e888d85fa7c8d6641 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/462488 Reviewed-by: Darek Stojaczyk Tested-by: SPDK CI Jenkins --- lib/ftl/ftl_band.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/ftl/ftl_band.c b/lib/ftl/ftl_band.c index ebd84dc99..9b2b82c20 100644 --- a/lib/ftl/ftl_band.c +++ b/lib/ftl/ftl_band.c @@ -611,6 +611,7 @@ ftl_band_next_xfer_ppa(struct ftl_band *band, struct ftl_ppa ppa, size_t num_lbk } chunk = ftl_band_next_operational_chunk(band, chunk); + assert(chunk); ppa.grp = chunk->start_ppa.grp; ppa.pu = chunk->start_ppa.pu;