1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-04 09:18:36 +03:00

cov: validate origin pointer

Add internal error for NULL origin here.
This commit is contained in:
Zdenek Kabelac 2024-03-25 16:57:53 +01:00
parent ac90ab7736
commit 4f1d89d37f

View File

@ -2151,7 +2151,11 @@ static int _lvconvert_merge_old_snapshot(struct cmd_context *cmd,
if (!snap_seg) if (!snap_seg)
return_0; return_0;
origin = origin_from_cow(lv); if (!(origin = origin_from_cow(lv))) {
log_error(INTERNAL_ERROR "Cannot get origin from %s COW.",
display_lvname(lv));
return 0;
}
/* Check if merge is possible */ /* Check if merge is possible */
if (lv_is_merging_origin(origin)) { if (lv_is_merging_origin(origin)) {