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

Commit 94b397cd authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Greg Kroah-Hartman
Browse files

staging: rdma: hfi1: Replace kmalloc and memcpy with kmemdup



Replace kmalloc and memcpy with kmemdup. Found using Coccinelle.

The semantic patch used to make this change can be found here:
scripts/coccinelle/api/memdup.cocci

Signed-off-by: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1e613801
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -127,13 +127,12 @@ static int read_efi_var(const char *name, unsigned long *size,
	 * temporary buffer.  Now allocate a correctly sized
	 * buffer.
	 */
	data = kmalloc(temp_size, GFP_KERNEL);
	data = kmemdup(temp_buffer, temp_size, GFP_KERNEL);
	if (!data) {
		ret = -ENOMEM;
		goto fail;
	}

	memcpy(data, temp_buffer, temp_size);
	*size = temp_size;
	*return_data = data;