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

Commit 42f9de6e authored by Peter Huewe's avatar Peter Huewe Committed by Mauro Carvalho Chehab
Browse files

[media] staging/media/go7007: Use kmemdup rather than duplicating its implementation



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

Signed-off-by: default avatarPeter Huewe <peterhuewe@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0a147c3b
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -108,14 +108,13 @@ static int go7007_load_encoder(struct go7007 *go)
		return -1;
	}
	fw_len = fw_entry->size - 16;
	bounce = kmalloc(fw_len, GFP_KERNEL);
	bounce = kmemdup(fw_entry->data + 16, fw_len, GFP_KERNEL);
	if (bounce == NULL) {
		v4l2_err(go, "unable to allocate %d bytes for "
				"firmware transfer\n", fw_len);
		release_firmware(fw_entry);
		return -1;
	}
	memcpy(bounce, fw_entry->data + 16, fw_len);
	release_firmware(fw_entry);
	if (go7007_interface_reset(go) < 0 ||
			go7007_send_firmware(go, bounce, fw_len) < 0 ||