* [PATCH] PVRUSB2: Cocci spatch "memdup.spatch"
@ 2013-06-01 9:38 Thomas Meyer
0 siblings, 0 replies; only message in thread
From: Thomas Meyer @ 2013-06-01 9:38 UTC (permalink / raw)
To: isely, mchehab, linux-media, linux-kernel
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/drivers/media/usb/pvrusb2/pvrusb2-io.c b/drivers/media/usb/pvrusb2/pvrusb2-io.c
--- a/drivers/media/usb/pvrusb2/pvrusb2-io.c
+++ b/drivers/media/usb/pvrusb2/pvrusb2-io.c
@@ -354,9 +354,9 @@ static int pvr2_stream_buffer_count(stru
if (scnt < sp->buffer_slot_count) {
struct pvr2_buffer **nb = NULL;
if (scnt) {
- nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL);
+ nb = kmemdup(sp->buffers, scnt * sizeof(*nb),
+ GFP_KERNEL);
if (!nb) return -ENOMEM;
- memcpy(nb,sp->buffers,scnt * sizeof(*nb));
}
kfree(sp->buffers);
sp->buffers = nb;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-06-01 10:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01 9:38 [PATCH] PVRUSB2: Cocci spatch "memdup.spatch" Thomas Meyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox