From 242bf56413f67dc3dd16770d420ced06eed0c4be Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Wed, 26 Apr 2023 13:44:52 +0200 Subject: [PATCH] cov: validata top_lv Add explicit pointer check is never NULL. --- lib/metadata/lv_manip.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 2dfa3c77b..8975bf180 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -5951,6 +5951,11 @@ static void _setup_params_for_extend_metadata(struct logical_volume *lv, static int _lv_resize_check_used(struct logical_volume *lv) { + if (!lv) { + log_error(INTERNAL_ERROR "LV is not specified."); + return 0; + } + if (lv_is_locked(lv)) { log_error("Can't resize locked logical volume %s.", display_lvname(lv)); return 0;