Commit 07342664 authored by Thomas Meyer's avatar Thomas Meyer Committed by Mauro Carvalho Chehab

[media] pvrusb2: Cocci spatch "memdup.spatch"

Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a19b56e5
...@@ -354,9 +354,9 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt) ...@@ -354,9 +354,9 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
if (scnt < sp->buffer_slot_count) { if (scnt < sp->buffer_slot_count) {
struct pvr2_buffer **nb = NULL; struct pvr2_buffer **nb = NULL;
if (scnt) { if (scnt) {
nb = kmalloc(scnt * sizeof(*nb),GFP_KERNEL); nb = kmemdup(sp->buffers, scnt * sizeof(*nb),
GFP_KERNEL);
if (!nb) return -ENOMEM; if (!nb) return -ENOMEM;
memcpy(nb,sp->buffers,scnt * sizeof(*nb));
} }
kfree(sp->buffers); kfree(sp->buffers);
sp->buffers = nb; sp->buffers = nb;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment