| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 13/14] mkfs: catch unknown format in protofile parsing |
| From: | Eric Sandeen <sandeen@xxxxxxxxxx> |
| Date: | Tue, 8 Apr 2014 18:25:03 -0500 |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1396999504-13769-1-git-send-email-sandeen@xxxxxxxxxx> |
| References: | <1396999504-13769-1-git-send-email-sandeen@xxxxxxxxxx> |
As the code stands today we can't get an unknown format in the
last case statement, but Coverity warns that if we ever do, we'll
use an uninitialized "ip" in the call to libxfs_trans_log_inode().
Adding a default: case to catch unknown formats is defensive and
makes the checker happy.
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---
mkfs/proto.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/mkfs/proto.c b/mkfs/proto.c
index 95583c9..308325b 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -591,6 +591,9 @@ parseproto(
}
libxfs_iput(ip, 0);
return;
+ default:
+ ASSERT(0);
+ fail(_("Unknown format"), EINVAL);
}
libxfs_trans_log_inode(tp, ip, flags);
error = libxfs_bmap_finish(&tp, &flist, &committed);
--
1.7.1
|
| Previous by Date: | [PATCH 04/14] xfsprogs: fix memory leak in xlog_recover_add_to_trans, Eric Sandeen |
|---|---|
| Next by Date: | [PATCH 12/14] xfs_repair: address never-true tests in repair/bmap.c on 64 bit, Eric Sandeen |
| Previous by Thread: | [PATCH 04/14] xfsprogs: fix memory leak in xlog_recover_add_to_trans, Eric Sandeen |
| Next by Thread: | [PATCH 12/14] xfs_repair: address never-true tests in repair/bmap.c on 64 bit, Eric Sandeen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |