Whamcloud - gitweb
[COVERITY] Fix memory leak in libss (ss_execute_line)
[tools/e2fsprogs.git] / debugfs / icheck.c
index 75044a6..e3646de 100644 (file)
@@ -30,11 +30,11 @@ struct block_walk_struct {
        ext2_ino_t              inode;
 };
 
-static int icheck_proc(ext2_filsys fs,
+static int icheck_proc(ext2_filsys fs EXT2FS_ATTR((unused)),
                       blk_t    *block_nr,
-                      e2_blkcnt_t blockcnt,
-                      blk_t ref_block,
-                      int ref_offset,
+                      e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
+                      blk_t ref_block EXT2FS_ATTR((unused)),
+                      int ref_offset EXT2FS_ATTR((unused)),
                       void *private)
 {
        struct block_walk_struct *bw = (struct block_walk_struct *) private;
@@ -109,8 +109,11 @@ void do_icheck(int argc, char **argv)
                if (!inode.i_links_count)
                        goto next;
 
+               bw.inode = ino;
+
                if (inode.i_file_acl) {
-                       icheck_proc(fs, &inode.i_file_acl, 0, 0, 0, &bw);
+                       icheck_proc(current_fs, &inode.i_file_acl, 0,
+                                   0, 0, &bw);
                        if (bw.blocks_left == 0)
                                break;
                }
@@ -124,8 +127,6 @@ void do_icheck(int argc, char **argv)
                if (inode.i_dtime)
                        goto next;
 
-               bw.inode = ino;
-
                retval = ext2fs_block_iterate2(current_fs, ino, 0, block_buf,
                                               icheck_proc, &bw);
                if (retval) {