Skip to content

Commit e34bace

Browse files
committed
nvme: initialize get-feature command result value as zero
This is to resolve the build error below. ../nvme.c:4851:9: error: ‘result’ may be used uninitialized [-Werror=maybe-uninitialized] 4851 | nvme_show_feature(cfg.feature_id, cfg.sel, result, buf, ... | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4852 | flags); | ~~~~~~ ../nvme.c: In function ‘get_feature’: ../nvme.c:4874:15: note: ‘result’ was declared here 4874 | __u64 result; | ^~~~~~ Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent bd8271a commit e34bace

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

nvme.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4871,7 +4871,7 @@ static int get_feature_id_changed(struct libnvme_transport_handle *hdl, struct f
48714871
__cleanup_free void *buf_def = NULL;
48724872
__cleanup_free void *buf = NULL;
48734873
__u64 result_def = 0;
4874-
__u64 result;
4874+
__u64 result = 0;
48754875
int err_def = 0;
48764876
int err;
48774877

0 commit comments

Comments
 (0)