Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvme: use _cleanup_free_ type buffer for get-feature command #2400

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions nvme.c
Original file line number Diff line number Diff line change
Expand Up @@ -4650,8 +4650,8 @@ static int get_feature_id_changed(struct nvme_dev *dev, struct feat_cfg cfg,
int err_def = 0;
__u32 result;
__u32 result_def;
void *buf = NULL;
void *buf_def = NULL;
_cleanup_free_ void *buf = NULL;
_cleanup_free_ void *buf_def = NULL;

if (changed)
cfg.sel = 0;
Expand All @@ -4670,9 +4670,6 @@ static int get_feature_id_changed(struct nvme_dev *dev, struct feat_cfg cfg,
(buf && buf_def && !strcmp(buf, buf_def)))
get_feature_id_print(cfg, err, result, buf);

free(buf);
free(buf_def);

return err;
}

Expand Down