Skip to content

Commit

Permalink
linux: default init cleanup variable
Browse files Browse the repository at this point in the history
gcc sometimes has troubles to figure out if a variable is used without
initialization when using the cleanup helpers.

Signed-off-by: Daniel Wagner <[email protected]>
  • Loading branch information
igaw committed May 10, 2024
1 parent 06b8853 commit 85db71d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/nvme/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ int nvme_get_new_host_telemetry(int fd, struct nvme_telemetry_log **log,

int nvme_get_lba_status_log(int fd, bool rae, struct nvme_lba_status_log **log)
{
_cleanup_free_ struct nvme_lba_status_log *buf = NULL;
__u32 size;
_cleanup_free_ struct nvme_lba_status_log *buf;
void *tmp;
int err;
struct nvme_get_log_args args = {
Expand Down
4 changes: 2 additions & 2 deletions src/nvme/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1601,8 +1601,8 @@ nvme_ctrl_t __nvme_lookup_ctrl(nvme_subsystem_t s, const char *transport,
const char *host_iface, const char *trsvcid,
const char *subsysnqn, nvme_ctrl_t p)
{
_cleanup_candidate_ struct candidate_args candidate = {};
struct nvme_ctrl *c, *matching_c = NULL;
_cleanup_candidate_ struct candidate_args candidate;
ctrl_match_t ctrl_match;

/* Init candidate and get the matching function to use */
Expand All @@ -1625,8 +1625,8 @@ bool nvme_ctrl_config_match(struct nvme_ctrl *c, const char *transport,
const char *subsysnqn, const char *host_traddr,
const char *host_iface)
{
_cleanup_candidate_ struct candidate_args candidate = {};
ctrl_match_t ctrl_match;
_cleanup_candidate_ struct candidate_args candidate;

/* Init candidate and get the matching function to use */
ctrl_match = _candidate_init(&candidate, transport, traddr, trsvcid,
Expand Down

0 comments on commit 85db71d

Please sign in to comment.