1
0
Fork 0

Btrfs: Cocci spatch "memdup.spatch"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
hifive-unleashed-5.1
Thomas Meyer 2013-06-01 09:37:50 +00:00 committed by Josef Bacik
parent 97a184fe81
commit a5959bc0a1
1 changed files with 1 additions and 2 deletions

View File

@ -3422,10 +3422,9 @@ static int __find_xattr(int num, struct btrfs_key *di_key,
strncmp(name, ctx->name, name_len) == 0) {
ctx->found_idx = num;
ctx->found_data_len = data_len;
ctx->found_data = kmalloc(data_len, GFP_NOFS);
ctx->found_data = kmemdup(data, data_len, GFP_NOFS);
if (!ctx->found_data)
return -ENOMEM;
memcpy(ctx->found_data, data, data_len);
return 1;
}
return 0;