mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
cov: mask some warning about leakage
Mask false-positive leak report.
This commit is contained in:
parent
548c69f581
commit
1b52451996
@ -245,6 +245,7 @@ static void daemonize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOG_OPEN("cmirrord", LOG_PID, LOG_DAEMON);
|
LOG_OPEN("cmirrord", LOG_PID, LOG_DAEMON);
|
||||||
|
/* coverity[leaked_handle] devnull cannot leak here */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1072,6 +1072,7 @@ out:
|
|||||||
* "label at end of compound statement" */
|
* "label at end of compound statement" */
|
||||||
;
|
;
|
||||||
|
|
||||||
|
/* coverity[lock_order] _global_mutex is kept locked */
|
||||||
pthread_cleanup_pop(1);
|
pthread_cleanup_pop(1);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -392,6 +392,7 @@ struct io_engine *create_async_io_engine(void)
|
|||||||
|
|
||||||
e->page_mask = (unsigned) _pagesize - 1;
|
e->page_mask = (unsigned) _pagesize - 1;
|
||||||
|
|
||||||
|
/* coverity[leaked_storage] 'e' is not leaking */
|
||||||
return &e->e;
|
return &e->e;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,7 +607,8 @@ struct io_engine *create_sync_io_engine(void)
|
|||||||
e->e.wait = _sync_wait;
|
e->e.wait = _sync_wait;
|
||||||
e->e.max_io = _sync_max_io;
|
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;
|
return &e->e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,6 +408,8 @@ static void _daemonise(daemon_state s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
setsid();
|
setsid();
|
||||||
|
|
||||||
|
/* coverity[leaked_handle] 'fd' handle is not leaking */
|
||||||
}
|
}
|
||||||
|
|
||||||
response daemon_reply_simple(const char *id, ...)
|
response daemon_reply_simple(const char *id, ...)
|
||||||
|
@ -664,6 +664,7 @@ static int _daemonise(struct filemap_monitor *fm)
|
|||||||
if (fd > STDERR_FILENO)
|
if (fd > STDERR_FILENO)
|
||||||
(void) close(fd);
|
(void) close(fd);
|
||||||
_early_log("Error redirecting stdin/out/err to null.");
|
_early_log("Error redirecting stdin/out/err to null.");
|
||||||
|
/* coverity[leaked_handle] no leak */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (fd > STDERR_FILENO)
|
if (fd > STDERR_FILENO)
|
||||||
|
@ -482,6 +482,7 @@ struct Source {
|
|||||||
|
|
||||||
virtual void sync( Sink *sink ) {
|
virtual void sync( Sink *sink ) {
|
||||||
ssize_t sz;
|
ssize_t sz;
|
||||||
|
/* coverity[stack_use_local_overflow] */
|
||||||
char buf[ 128 * 1024 ];
|
char buf[ 128 * 1024 ];
|
||||||
if ( (sz = read(fd, buf, sizeof(buf) - 1)) > 0 )
|
if ( (sz = read(fd, buf, sizeof(buf) - 1)) > 0 )
|
||||||
sink->push( std::string( buf, sz ) );
|
sink->push( std::string( buf, sz ) );
|
||||||
|
@ -67,6 +67,7 @@ static void *_fix_init(struct io_engine *engine)
|
|||||||
T_ASSERT(f);
|
T_ASSERT(f);
|
||||||
|
|
||||||
snprintf(f->fname, sizeof(f->fname), "unit-test-XXXXXX");
|
snprintf(f->fname, sizeof(f->fname), "unit-test-XXXXXX");
|
||||||
|
/* coverity[secure_temp] don't care */
|
||||||
f->fd = mkstemp(f->fname);
|
f->fd = mkstemp(f->fname);
|
||||||
T_ASSERT(f->fd >= 0);
|
T_ASSERT(f->fd >= 0);
|
||||||
|
|
||||||
@ -243,6 +244,7 @@ static void _reopen(struct fixture *f)
|
|||||||
|
|
||||||
static uint8_t _random_pattern(void)
|
static uint8_t _random_pattern(void)
|
||||||
{
|
{
|
||||||
|
/* coverity[dont_call] don't care */
|
||||||
return random();
|
return random();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,6 +89,7 @@ static void *_fix_init(void)
|
|||||||
test_fail("posix_memalign failed");
|
test_fail("posix_memalign failed");
|
||||||
|
|
||||||
snprintf(f->fname, sizeof(f->fname), "unit-test-XXXXXX");
|
snprintf(f->fname, sizeof(f->fname), "unit-test-XXXXXX");
|
||||||
|
/* coverity[secure_temp] don't care */
|
||||||
f->fd = mkstemp(f->fname);
|
f->fd = mkstemp(f->fname);
|
||||||
T_ASSERT(f->fd >= 0);
|
T_ASSERT(f->fd >= 0);
|
||||||
|
|
||||||
|
@ -169,6 +169,7 @@ static void test_prefix_keys_reversed(void *fixture)
|
|||||||
static void _gen_key(uint8_t *b, uint8_t *e)
|
static void _gen_key(uint8_t *b, uint8_t *e)
|
||||||
{
|
{
|
||||||
for (; b != e; b++)
|
for (; b != e; b++)
|
||||||
|
/* coverity[dont_call] don't care */
|
||||||
*b = rand() % 256;
|
*b = rand() % 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +200,7 @@ static void _run_test(struct test_details *t, bool use_colour, unsigned *passed,
|
|||||||
|
|
||||||
(*passed)++;
|
(*passed)++;
|
||||||
fprintf(stderr, "%s[ OK]%s\n", green(use_colour), normal(use_colour));
|
fprintf(stderr, "%s[ OK]%s\n", green(use_colour), normal(use_colour));
|
||||||
|
/* coverity[leaked_storage] fixture released by fixture_exit */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,6 +111,8 @@ int become_daemon(struct cmd_context *cmd, int skip_lvm)
|
|||||||
_exit(ECMD_FAILED);
|
_exit(ECMD_FAILED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* coverity[leaked_handle] null_fd does not leak here */
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user