diff options
author | Thomas Meyer <thomas@m3y3r.de> | 2013-06-01 05:37:50 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-06-14 11:30:12 -0400 |
commit | a5959bc0a1920d54c07b26a67b104caaf28f0a8c (patch) | |
tree | edca21c483644b909078daec084818f6826c09e6 /fs/btrfs | |
parent | 97a184fe818ceb12ce511d7add4be5ded85c8ba0 (diff) |
Btrfs: Cocci spatch "memdup.spatch"
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/send.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index db381cf94943..d3f3b43cae0b 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -3422,10 +3422,9 @@ static int __find_xattr(int num, struct btrfs_key *di_key, | |||
3422 | strncmp(name, ctx->name, name_len) == 0) { | 3422 | strncmp(name, ctx->name, name_len) == 0) { |
3423 | ctx->found_idx = num; | 3423 | ctx->found_idx = num; |
3424 | ctx->found_data_len = data_len; | 3424 | ctx->found_data_len = data_len; |
3425 | ctx->found_data = kmalloc(data_len, GFP_NOFS); | 3425 | ctx->found_data = kmemdup(data, data_len, GFP_NOFS); |
3426 | if (!ctx->found_data) | 3426 | if (!ctx->found_data) |
3427 | return -ENOMEM; | 3427 | return -ENOMEM; |
3428 | memcpy(ctx->found_data, data, data_len); | ||
3429 | return 1; | 3428 | return 1; |
3430 | } | 3429 | } |
3431 | return 0; | 3430 | return 0; |