Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] [media] drxd: Use kmemdup rather than duplicating its implementation
@ 2011-11-17 22:43 Thomas Meyer
  0 siblings, 0 replies; only message in thread
From: Thomas Meyer @ 2011-11-17 22:43 UTC (permalink / raw)
  To: mchehab, linux-media, linux-kernel

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

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c
--- a/drivers/media/dvb/frontends/drxd_hard.c 2011-11-07 19:37:48.623295422 +0100
+++ b/drivers/media/dvb/frontends/drxd_hard.c 2011-11-08 10:48:49.317800208 +0100
@@ -914,14 +914,13 @@ static int load_firmware(struct drxd_sta
 		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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-11-18  9:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-17 22:43 [PATCH] [media] drxd: Use kmemdup rather than duplicating its implementation Thomas Meyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox