Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5959bc0 authored by Thomas Meyer's avatar Thomas Meyer Committed by Josef Bacik
Browse files

Btrfs: Cocci spatch "memdup.spatch"



Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
parent 97a184fe
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -3422,10 +3422,9 @@ static int __find_xattr(int num, struct btrfs_key *di_key,
	    strncmp(name, ctx->name, name_len) == 0) {
	    strncmp(name, ctx->name, name_len) == 0) {
		ctx->found_idx = num;
		ctx->found_idx = num;
		ctx->found_data_len = data_len;
		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)
		if (!ctx->found_data)
			return -ENOMEM;
			return -ENOMEM;
		memcpy(ctx->found_data, data, data_len);
		return 1;
		return 1;
	}
	}
	return 0;
	return 0;