提交 07342664 编写于 作者: T Thomas Meyer 提交者: Mauro Carvalho Chehab

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

Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 a19b56e5
......@@ -354,9 +354,9 @@ static int pvr2_stream_buffer_count(struct pvr2_stream *sp,unsigned int cnt)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册