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

Commit 53090aad authored by Thomas Meyer's avatar Thomas Meyer Committed by Mauro Carvalho Chehab
Browse files

[media] drxd: Use kmemdup rather than duplicating its implementation



The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d1190024
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -914,14 +914,13 @@ static int load_firmware(struct drxd_state *state, const char *fw_name)
		return -EIO;
	}

	state->microcode = kmalloc(fw->size, GFP_KERNEL);
	state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL);
	if (state->microcode == NULL) {
		release_firmware(fw);
		printk(KERN_ERR "drxd: firmware load failure: no memory\n");
		return -ENOMEM;
	}

	memcpy(state->microcode, fw->data, fw->size);
	state->microcode_length = fw->size;
	release_firmware(fw);
	return 0;