From: Eric Sandeen Date: Mon, 14 Apr 2014 06:13:44 +0000 (+1000) Subject: mkfs: catch unknown format in protofile parsing X-Git-Tag: v3.2.0-rc1~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3ddc4aeb29415d6fbbb77528088782183d5a59d5;p=thirdparty%2Fxfsprogs-dev.git mkfs: catch unknown format in protofile parsing 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 Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- diff --git a/mkfs/proto.c b/mkfs/proto.c index 95583c90b..308325be2 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);