From 97a02a98782c53c39536751dcefcbd5a610607cd Mon Sep 17 00:00:00 2001 From: Marcin Spiewak Date: Thu, 13 Apr 2023 12:06:50 +0000 Subject: [PATCH] lib/lvol: lvs_load() shall return, if options are invalid lvs_load() function verifies if options passed to it are valid, but doesn't return, if they are not (only error is logged and callback is called with -EINVAL code). Now it is corrected and the function ends after the error is reported. Change-Id: I19b0b22466b6980345477f62084d27ef13414752 Signed-off-by: Marcin Spiewak Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17582 Tested-by: SPDK CI Jenkins Reviewed-by: Mike Gerdts Reviewed-by: Jim Harris Community-CI: Mellanox Build Bot Reviewed-by: Konrad Sztyber --- lib/lvol/lvol.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/lvol/lvol.c b/lib/lvol/lvol.c index 832eacc75..e119e91b7 100644 --- a/lib/lvol/lvol.c +++ b/lib/lvol/lvol.c @@ -422,6 +422,7 @@ lvs_load(struct spdk_bs_dev *bs_dev, const struct spdk_lvs_opts *_lvs_opts, if (lvs_opts_copy(_lvs_opts, &lvs_opts) != 0) { SPDK_ERRLOG("Invalid options\n"); cb_fn(cb_arg, NULL, -EINVAL); + return; } }