diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-12-20 08:53:44 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-12-21 18:29:14 -0800 |
commit | cad0e61555c65b66a828e81c117fe11fcae9cdad (patch) | |
tree | aaf9f7060000fcae9dbe346d35657b4fb66bb476 | |
parent | a4722a00441a804fe3e6a6df87bec4a30e26980b (diff) | |
download | xfsprogs-dev-cad0e61555c65b66a828e81c117fe11fcae9cdad.tar.gz |
xfs_mdrestore: fix uninitialized variables in mdrestore main
Coverity complained about the "is fd a file?" flags being uninitialized.
Clean this up.
Coverity-id: 1554270
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chandan Babu R <chandanbabu@kernel.org>
-rw-r--r-- | mdrestore/xfs_mdrestore.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index 2de177c6e3..5dfc423493 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -472,11 +472,11 @@ main( union mdrestore_headers headers; FILE *src_f; char *logdev = NULL; - int data_dev_fd; - int log_dev_fd; + int data_dev_fd = -1; + int log_dev_fd = -1; int c; - bool is_data_dev_file; - bool is_log_dev_file; + bool is_data_dev_file = false; + bool is_log_dev_file = false; mdrestore.show_progress = false; mdrestore.show_info = false; @@ -561,7 +561,6 @@ main( /* check and open data device */ data_dev_fd = open_device(argv[optind], &is_data_dev_file); - log_dev_fd = -1; if (mdrestore.external_log) /* check and open log device */ log_dev_fd = open_device(logdev, &is_log_dev_file); |