main - cov: mask some warning about leakage
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1b5245199680841fd088cf1a834b3623b3ef18d0 Commit: 1b5245199680841fd088cf1a834b3623b3ef18d0 Parent: 548c69f58174b3cb3997c0fcff09276bd7502796 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sun Sep 19 20:21:55 2021 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Sep 20 14:26:09 2021 +0200
cov: mask some warning about leakage
Mask false-positive leak report.
--- daemons/cmirrord/clogd.c | 1 + daemons/dmeventd/dmeventd.c | 1 + lib/device/bcache.c | 4 +++- libdaemon/server/daemon-server.c | 2 ++ libdm/dm-tools/dmfilemapd.c | 1 + test/lib/brick-shelltest.h | 1 + test/unit/bcache_utils_t.c | 2 ++ test/unit/io_engine_t.c | 1 + test/unit/radix_tree_t.c | 1 + test/unit/run.c | 1 + tools/toollib.c | 2 ++ 11 files changed, 16 insertions(+), 1 deletion(-)
daemons/cmirrord/clogd.c +1 -0
@@ -245,6 +245,7 @@ static void daemonize(void) }LOG_OPEN ("cmirrord" ,LOG_PID ,LOG_DAEMON ); +/* coverity[leaked_handle] devnull cannot leak here */ }/*
daemons/dmeventd/dmeventd.c +1 -0
@@ -1072,6 +1072,7 @@ out:* "label at end of compound statement" */ ; +/* coverity[lock_order] _global_mutex is kept locked */ pthread_cleanup_pop (1 );return NULL ;
lib/device/bcache.c +3 -1
@@ -392,6 +392,7 @@ struct io_engine *create_async_io_engine(void) e->page_mask = (unsigned ) _pagesize -1 ; +/* coverity[leaked_storage] 'e' is not leaking */ return &e->e; }
@@ -606,7 +607,8 @@ struct io_engine *create_sync_io_engine(void) e->e.wait = _sync_wait; e->e.max_io = _sync_max_io; -dm_list_init (&e->complete); +dm_list_init (&e->complete); +/* coverity[leaked_storage] 'e' is not leaking */ return &e->e; }
libdaemon/server/daemon-server.c +2 -0
@@ -408,6 +408,8 @@ static void _daemonise(daemon_state s) }setsid (); + +/* coverity[leaked_handle] 'fd' handle is not leaking */ }response daemon_reply_simple (const char *id, ...)
libdm/dm-tools/dmfilemapd.c +1 -0
@@ -664,6 +664,7 @@ static int _daemonise(struct filemap_monitor *fm)if (fd >STDERR_FILENO ) (void )close (fd);_early_log ("Error redirecting stdin/out/err to null." ); +/* coverity[leaked_handle] no leak */ return 0 ; }if (fd >STDERR_FILENO )
test/lib/brick-shelltest.h +1 -0
@@ -482,6 +482,7 @@ struct Source { virtual void sync( Sink *sink ) {ssize_t sz; +/* coverity[stack_use_local_overflow] */ char buf[128 *1024 ];if ( (sz =read (fd, buf,sizeof (buf) -1 )) >0 ) sink->push( std::string( buf, sz ) );
test/unit/bcache_utils_t.c +2 -0
@@ -67,6 +67,7 @@ static void *_fix_init(struct io_engine *engine)T_ASSERT (f);snprintf (f->fname,sizeof (f->fname),"unit-test-XXXXXX" ); +/* coverity[secure_temp] don't care */ f->fd =mkstemp (f->fname);T_ASSERT (f->fd >=0 );
@@ -243,6 +244,7 @@ static void _reopen(struct fixture *f)static uint8_t _random_pattern (void ) { +/* coverity[dont_call] don't care */ return random (); }
test/unit/io_engine_t.c +1 -0
@@ -89,6 +89,7 @@ static void *_fix_init(void)test_fail ("posix_memalign failed" );snprintf (f->fname,sizeof (f->fname),"unit-test-XXXXXX" ); +/* coverity[secure_temp] don't care */ f->fd =mkstemp (f->fname);T_ASSERT (f->fd >=0 );
test/unit/radix_tree_t.c +1 -0
@@ -169,6 +169,7 @@ static void test_prefix_keys_reversed(void *fixture)static void _gen_key (uint8_t *b,uint8_t *e) {for (; b != e; b++) +/* coverity[dont_call] don't care */ *b =rand () %256 ; }
test/unit/run.c +1 -0
@@ -200,6 +200,7 @@ static void _run_test(struct test_details *t, bool use_colour, unsigned *passed, (*passed)++;fprintf (stderr,"%s[ OK]%s\n" ,green (use_colour),normal (use_colour)); +/* coverity[leaked_storage] fixture released by fixture_exit */ } }
tools/toollib.c +2 -0
@@ -111,6 +111,8 @@ int become_daemon(struct cmd_context *cmd, int skip_lvm)_exit (ECMD_FAILED ); } +/* coverity[leaked_handle] null_fd does not leak here */ +return 1 ; }