mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 10:50:54 +07:00
V4L/DVB: pvrusb2: Avoid using stack allocated buffers when performing USB I/O
Drivers shouldn't assume that the stack is DMA-safe. [mchehab@redhat.com: fix patch description] Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
c641a18969
commit
6861800c15
@ -4084,12 +4084,20 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw)
|
||||
|
||||
void pvr2_hdw_cpureset_assert(struct pvr2_hdw *hdw,int val)
|
||||
{
|
||||
char da[1];
|
||||
char *da;
|
||||
unsigned int pipe;
|
||||
int ret;
|
||||
|
||||
if (!hdw->usb_dev) return;
|
||||
|
||||
da = kmalloc(16, GFP_KERNEL);
|
||||
|
||||
if (da == NULL) {
|
||||
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
|
||||
"Unable to allocate memory to control CPU reset");
|
||||
return;
|
||||
}
|
||||
|
||||
pvr2_trace(PVR2_TRACE_INIT,"cpureset_assert(%d)",val);
|
||||
|
||||
da[0] = val ? 0x01 : 0x00;
|
||||
@ -4103,6 +4111,8 @@ void pvr2_hdw_cpureset_assert(struct pvr2_hdw *hdw,int val)
|
||||
"cpureset_assert(%d) error=%d",val,ret);
|
||||
pvr2_hdw_render_useless(hdw);
|
||||
}
|
||||
|
||||
kfree(da);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user