btrfs-progs: don't deref pipefd[-1]
authorZach Brown <zab@redhat.com>
Mon, 7 Oct 2013 21:43:02 +0000 (14:43 -0700)
committerChris Mason <chris.mason@fusionio.com>
Wed, 16 Oct 2013 12:23:13 +0000 (08:23 -0400)
commit 4782e8ebdb583dfa3615f7b38dee729d34f62ec1 accidentally replaced
[0] with [-1].  Put it back.  This was found by static analysis.

Signed-off-by: Zach Brown <zab@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
send-test.c

index 3775f5f..a37b7fd 100644 (file)
@@ -354,7 +354,7 @@ static void *process_thread(void *arg_)
        int ret;
 
        while (1) {
-               ret = btrfs_read_and_process_send_stream(pipefd[-1],
+               ret = btrfs_read_and_process_send_stream(pipefd[0],
                                                         &send_ops_print, arg_, 0);
                if (ret)
                        break;