mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +03:00
Merge pull request #19863 from keszybz/coverity-drop-unitialized-workarounds
Drop some -Wmaybe-unitialized workarounds to help coverity
This commit is contained in:
commit
bb25f236d4
@ -1056,7 +1056,7 @@ static int attach_luks_or_plain_or_bitlk_by_tpm2(
|
||||
_cleanup_(sd_event_unrefp) sd_event *event = NULL;
|
||||
_cleanup_free_ char *friendly = NULL;
|
||||
int keyslot = arg_key_slot, r;
|
||||
size_t decrypted_key_size = 0; /* avoid false maybe-uninitialized warning */
|
||||
size_t decrypted_key_size;
|
||||
|
||||
assert(cd);
|
||||
assert(name);
|
||||
|
@ -338,7 +338,9 @@ static int routing_policy_rule_add(Manager *m, const RoutingPolicyRule *in, Rout
|
||||
|
||||
rule->manager = m;
|
||||
existing = TAKE_PTR(rule);
|
||||
} else if (r == 0) {
|
||||
} else if (r < 0)
|
||||
return r;
|
||||
else if (r == 0) {
|
||||
/* Take over a foreign rule. */
|
||||
r = set_ensure_put(&m->rules, &routing_policy_rule_hash_ops, existing);
|
||||
if (r < 0)
|
||||
@ -346,11 +348,7 @@ static int routing_policy_rule_add(Manager *m, const RoutingPolicyRule *in, Rout
|
||||
assert(r > 0);
|
||||
|
||||
set_remove(m->rules_foreign, existing);
|
||||
} else if (r == 1) {
|
||||
/* Already exists, do nothing. */
|
||||
;
|
||||
} else
|
||||
return r;
|
||||
} /* else r > 0: already exists, do nothing. */
|
||||
|
||||
if (ret)
|
||||
*ret = existing;
|
||||
|
@ -692,7 +692,7 @@ int link_request_to_set_master(Link *link) {
|
||||
}
|
||||
|
||||
int link_request_to_set_mtu(Link *link, uint32_t mtu) {
|
||||
Request *req = NULL; /* avoid false maybe-uninitialized warning */
|
||||
Request *req;
|
||||
const char *origin;
|
||||
uint32_t min_mtu;
|
||||
int r;
|
||||
|
@ -248,7 +248,7 @@ static void test_ensure_cap_64bit(void) {
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
bool run_ambient = false; /* avoid false maybe-uninitialized warning */
|
||||
bool run_ambient;
|
||||
|
||||
test_setup_logging(LOG_INFO);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user