diff options
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r-- | fs/btrfs/send.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 1ac3ca98c429..fd38b5053479 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -349,6 +349,11 @@ static int fs_path_ensure_buf(struct fs_path *p, int len) | |||
349 | if (p->buf_len >= len) | 349 | if (p->buf_len >= len) |
350 | return 0; | 350 | return 0; |
351 | 351 | ||
352 | if (len > PATH_MAX) { | ||
353 | WARN_ON(1); | ||
354 | return -ENOMEM; | ||
355 | } | ||
356 | |||
352 | path_len = p->end - p->start; | 357 | path_len = p->end - p->start; |
353 | old_buf_len = p->buf_len; | 358 | old_buf_len = p->buf_len; |
354 | 359 | ||
@@ -1663,7 +1668,7 @@ static int get_first_ref(struct btrfs_root *root, u64 ino, | |||
1663 | goto out; | 1668 | goto out; |
1664 | } | 1669 | } |
1665 | 1670 | ||
1666 | if (key.type == BTRFS_INODE_REF_KEY) { | 1671 | if (found_key.type == BTRFS_INODE_REF_KEY) { |
1667 | struct btrfs_inode_ref *iref; | 1672 | struct btrfs_inode_ref *iref; |
1668 | iref = btrfs_item_ptr(path->nodes[0], path->slots[0], | 1673 | iref = btrfs_item_ptr(path->nodes[0], path->slots[0], |
1669 | struct btrfs_inode_ref); | 1674 | struct btrfs_inode_ref); |