PVRUSB2: Cocci spatch "memdup.spatch"
Subsystems (2)
PATCH 1/1 PVRUSB2: Cocci spatch "memdup.spatch"
Signed-off-by Thomas Meyer <[email protected]>
---
drivers/media/usb/pvrusb2/pvrusb2-io.c +2 -2
@@ -354,9 +354,9 @@ static int pvr2_stream_buffer_count(struif (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;