diff options
author | Eric Sandeen <sandeen@redhat.com> | 2011-09-16 15:49:20 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-16 18:43:04 -0400 |
commit | d0f196d867504d8461fb7c6958aa6a5d220d5825 (patch) | |
tree | 2654831f2972469d87da59e06a19f04ba8530b43 /lib | |
parent | 4d5cf8b166bb29f0e3280bbadca9d3a8b895acd1 (diff) | |
download | e2fsprogs-d0f196d867504d8461fb7c6958aa6a5d220d5825.tar.gz |
libext2: move buf variable completely under ifdef
If !WORDS_BIGENDIAN, it is pointless to test whether buf
is NULL, because it is initialized to NULL and never changed.
This makes Coverity complain, so we can just move all handling
of "buf" under the #ifdef.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ext2fs/ext_attr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/ext2fs/ext_attr.c b/lib/ext2fs/ext_attr.c index 52664ebe..ddcc89f7 100644 --- a/lib/ext2fs/ext_attr.c +++ b/lib/ext2fs/ext_attr.c @@ -82,9 +82,9 @@ errcode_t ext2fs_write_ext_attr2(ext2_filsys fs, blk64_t block, void *inbuf) { errcode_t retval; char *write_buf; +#ifdef WORDS_BIGENDIAN char *buf = NULL; -#ifdef WORDS_BIGENDIAN retval = ext2fs_get_mem(fs->blocksize, &buf); if (retval) return retval; @@ -94,8 +94,9 @@ errcode_t ext2fs_write_ext_attr2(ext2_filsys fs, blk64_t block, void *inbuf) write_buf = (char *) inbuf; #endif retval = io_channel_write_blk64(fs->io, block, 1, write_buf); - if (buf) - ext2fs_free_mem(&buf); +#ifdef WORDS_BIGENDIAN + ext2fs_free_mem(&buf); +#endif if (!retval) ext2fs_mark_changed(fs); return retval; |