lvol: check argument for NULL in vbdev_lvol_store_next function

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: Id0f7751d8889584fff1a947160ee89e2f158af1c

Reviewed-on: https://review.gerrithub.io/388943
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Maciej Szwed 2017-11-24 14:19:36 +01:00 committed by Daniel Verkamp
parent 0b9cfae48f
commit 9e477c7b2e

View File

@ -268,6 +268,11 @@ vbdev_lvol_store_next(struct lvol_store_bdev *prev)
{
struct lvol_store_bdev *lvs_bdev;
if (prev == NULL) {
SPDK_ERRLOG("prev argument cannot be NULL\n");
return NULL;
}
lvs_bdev = TAILQ_NEXT(prev, lvol_stores);
if (lvs_bdev) {
SPDK_INFOLOG(SPDK_TRACE_VBDEV_LVOL, "Continuing lvolstore iteration at %p\n", lvs_bdev->lvs);