diff mbox

[18/37] drivers/media/video/tlg2300: Use kmemdup

Message ID Pine.LNX.4.64.1005152318160.21345@ask.diku.dk (mailing list archive)
State Accepted
Delegated to: Douglas Landgraf
Headers show

Commit Message

Julia Lawall May 15, 2010, 9:18 p.m. UTC
None
diff mbox

Patch

diff -u -p a/drivers/media/video/tlg2300/pd-main.c b/drivers/media/video/tlg2300/pd-main.c
--- a/drivers/media/video/tlg2300/pd-main.c
+++ b/drivers/media/video/tlg2300/pd-main.c
@@ -227,12 +227,11 @@  static int firmware_download(struct usb_
 
 	fwlength = fw->size;
 
-	fwbuf = kzalloc(fwlength, GFP_KERNEL);
+	fwbuf = kmemdup(fw->data, fwlength, GFP_KERNEL);
 	if (!fwbuf) {
 		ret = -ENOMEM;
 		goto out;
 	}
-	memcpy(fwbuf, fw->data, fwlength);
 
 	max_packet_size = udev->ep_out[0x1]->desc.wMaxPacketSize;
 	log("\t\t download size : %d", (int)max_packet_size);