1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: hide some false positives

Hide some false positives.

Note: there must not a be blank line after coverity hiding comment.
This commit is contained in:
Zdenek Kabelac 2023-05-10 13:01:37 +02:00
parent cc7c41abbd
commit d418fc14f4
6 changed files with 5 additions and 3 deletions

View File

@ -987,6 +987,7 @@ static void _monitor_unregister(void *arg)
DEBUGLOG("Unregistering monitor for %s.", thread->device.name); DEBUGLOG("Unregistering monitor for %s.", thread->device.name);
_unregister_for_timeout(thread); _unregister_for_timeout(thread);
/* coverity[missing_lock] no missing lock here */
if ((thread->status != DM_THREAD_REGISTERING) && if ((thread->status != DM_THREAD_REGISTERING) &&
!_do_unregister_device(thread)) !_do_unregister_device(thread))
log_error("%s: %s unregister failed.", __func__, log_error("%s: %s unregister failed.", __func__,
@ -1969,6 +1970,7 @@ static void _daemonize(void)
(void) close(fd); (void) close(fd);
} }
/* coverity[leaked_handle] dont't care */
if ((open("/dev/null", O_RDONLY) < 0) || if ((open("/dev/null", O_RDONLY) < 0) ||
(open("/dev/null", O_WRONLY) < 0) || (open("/dev/null", O_WRONLY) < 0) ||
(open("/dev/null", O_WRONLY) < 0)) (open("/dev/null", O_WRONLY) < 0))

View File

@ -123,6 +123,7 @@ struct dm_pool *dmeventd_lvm2_pool(void)
int dmeventd_lvm2_run(const char *cmdline) int dmeventd_lvm2_run(const char *cmdline)
{ {
/* coverity[missing_lock] no locking for run part */
return (lvm2_run(_lvm_handle, cmdline) == LVM2_COMMAND_SUCCEEDED); return (lvm2_run(_lvm_handle, cmdline) == LVM2_COMMAND_SUCCEEDED);
} }

View File

@ -223,7 +223,6 @@ retry_fcntl:
} }
/* coverity[leaked_handle] intentional leak of fd handle here */ /* coverity[leaked_handle] intentional leak of fd handle here */
return 1; return 1;
fail_close_unlink: fail_close_unlink:

View File

@ -899,6 +899,7 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info)
goto_out; goto_out;
if (_selection_cmd && selected) { if (_selection_cmd && selected) {
device_name = (char*) dm_task_get_name(dmt); device_name = (char*) dm_task_get_name(dmt);
/* coverity[overrun-buffer-val] _setgeometry never called from this place */
if (!_selection_cmd->fn(_selection_cmd, NULL, 1, &device_name, NULL, 1)) if (!_selection_cmd->fn(_selection_cmd, NULL, 1, &device_name, NULL, 1))
goto_out; goto_out;
} }

View File

@ -222,7 +222,6 @@ retry_fcntl:
} }
/* coverity[leaked_handle] intentional leak of fd handle here */ /* coverity[leaked_handle] intentional leak of fd handle here */
return 1; return 1;
fail_close_unlink: fail_close_unlink:

View File

@ -88,6 +88,7 @@ int become_daemon(struct cmd_context *cmd, int skip_lvm)
_exit(ECMD_FAILED); _exit(ECMD_FAILED);
} }
/* coverity[leaked_handle] don't care */
if ((dup2(null_fd, STDIN_FILENO) < 0) || /* reopen stdin */ if ((dup2(null_fd, STDIN_FILENO) < 0) || /* reopen stdin */
(dup2(null_fd, STDOUT_FILENO) < 0) || /* reopen stdout */ (dup2(null_fd, STDOUT_FILENO) < 0) || /* reopen stdout */
(dup2(null_fd, STDERR_FILENO) < 0)) { /* reopen stderr */ (dup2(null_fd, STDERR_FILENO) < 0)) { /* reopen stderr */
@ -113,7 +114,6 @@ int become_daemon(struct cmd_context *cmd, int skip_lvm)
} }
/* coverity[leaked_handle] null_fd does not leak here */ /* coverity[leaked_handle] null_fd does not leak here */
return 1; return 1;
} }