Whamcloud - gitweb
Silence valgrind warnings
authorTheodore Ts'o <tytso@mit.edu>
Sat, 26 Aug 2017 17:42:30 +0000 (13:42 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 28 Aug 2017 22:17:26 +0000 (18:17 -0400)
Valgrind doesn't understand that the kernel will be initializing the
struct termios and struct loop_info64 structures.  Since they occur in
functions which are not in the hot path, preinitialize to zero to
prevent valgrind from producing a huge number of false positives.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/util.c
lib/ext2fs/ismounted.c

index 43cb7a7..a297e58 100644 (file)
@@ -204,7 +204,7 @@ int ask_yn(e2fsck_t ctx, const char * string, int def)
        static int      yes_answers;
 
 #ifdef HAVE_TERMIOS_H
-       struct termios  termios, tmp;
+       struct termios  termios = {0, }, tmp;
 
        tcgetattr (0, &termios);
        tmp = termios;
index 7d52471..120299c 100644 (file)
@@ -66,7 +66,7 @@ static int check_loop_mounted(const char *mnt_fsname, dev_t mnt_rdev,
                                dev_t file_dev, ino_t file_ino)
 {
 #if defined(HAVE_LINUX_LOOP_H) && defined(HAVE_LINUX_MAJOR_H)
-       struct loop_info64 loopinfo;
+       struct loop_info64 loopinfo = {0, };
        int loop_fd, ret;
 
        if (major(mnt_rdev) == LOOP_MAJOR) {