In btrfs_read_dev_super(), a wrong parameter for memcpy will copy wrong
address of a stack pointer to super_copy.
Which will cause a lot of unpredictable error.

What a stupid typo from myself!!!!!

Signed-off-by: Qu Wenruo <[email protected]>
---
 disk-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk-io.c b/disk-io.c
index f7e6c41..139bc80 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -1480,7 +1480,7 @@ int btrfs_read_dev_super(int fd, struct btrfs_super_block 
*sb, u64 sb_bytenr,
 
                if (check_super(buf))
                        return -1;
-               memcpy(sb, &buf, BTRFS_SUPER_INFO_SIZE);
+               memcpy(sb, buf, BTRFS_SUPER_INFO_SIZE);
                return 0;
        }
 
-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to