From fa62397ff81ac4295d59b1af762fce00885cc050 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 9 Apr 2024 18:34:01 +0200 Subject: [PATCH] cov: mask false positive This code is somewhat complex and involves recursion and pointer shuffling which confuses coverity here. Let's add masking comment for this warning as there is no double free in this code. --- device_mapper/ioctl/libdm-iface.c | 2 ++ libdm/ioctl/libdm-iface.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/device_mapper/ioctl/libdm-iface.c b/device_mapper/ioctl/libdm-iface.c index df91bb5fd..fa105761f 100644 --- a/device_mapper/ioctl/libdm-iface.c +++ b/device_mapper/ioctl/libdm-iface.c @@ -1697,6 +1697,7 @@ static int _create_and_load_v4(struct dm_task *dmt) dmt->uuid = NULL; free(dmt->mangled_uuid); dmt->mangled_uuid = NULL; + /* coverity[double_free] recursive function call */ _dm_task_free_targets(dmt); if (dm_task_run(dmt)) @@ -1708,6 +1709,7 @@ static int _create_and_load_v4(struct dm_task *dmt) dmt->uuid = NULL; free(dmt->mangled_uuid); dmt->mangled_uuid = NULL; + /* coverity[double_free] recursive function call */ _dm_task_free_targets(dmt); /* diff --git a/libdm/ioctl/libdm-iface.c b/libdm/ioctl/libdm-iface.c index 9f37d2602..abc6d3379 100644 --- a/libdm/ioctl/libdm-iface.c +++ b/libdm/ioctl/libdm-iface.c @@ -1560,6 +1560,7 @@ static int _create_and_load_v4(struct dm_task *dmt) dmt->uuid = NULL; dm_free(dmt->mangled_uuid); dmt->mangled_uuid = NULL; + /* coverity[double_free] recursive function call */ _dm_task_free_targets(dmt); if (dm_task_run(dmt)) @@ -1571,6 +1572,7 @@ static int _create_and_load_v4(struct dm_task *dmt) dmt->uuid = NULL; dm_free(dmt->mangled_uuid); dmt->mangled_uuid = NULL; + /* coverity[double_free] recursive function call */ _dm_task_free_targets(dmt); /*