diff options
author | Mike Isely <isely@pobox.com> | 2010-05-14 23:09:47 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-06-01 00:19:47 -0400 |
commit | 6861800c1512ca8452c5f350a7c0af445ece773b (patch) | |
tree | 7c0f4898aebf138a72fadf069d01396beb053a0f /drivers/media/video/pvrusb2 | |
parent | c641a18969178ac1649e022156c85adb7c889451 (diff) |
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>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 301ef197d038..d13232d51823 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -4084,12 +4084,20 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *hdw) | |||
4084 | 4084 | ||
4085 | void pvr2_hdw_cpureset_assert(struct pvr2_hdw *hdw,int val) | 4085 | void pvr2_hdw_cpureset_assert(struct pvr2_hdw *hdw,int val) |
4086 | { | 4086 | { |
4087 | char da[1]; | 4087 | char *da; |
4088 | unsigned int pipe; | 4088 | unsigned int pipe; |
4089 | int ret; | 4089 | int ret; |
4090 | 4090 | ||
4091 | if (!hdw->usb_dev) return; | 4091 | if (!hdw->usb_dev) return; |
4092 | 4092 | ||
4093 | da = kmalloc(16, GFP_KERNEL); | ||
4094 | |||
4095 | if (da == NULL) { | ||
4096 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | ||
4097 | "Unable to allocate memory to control CPU reset"); | ||
4098 | return; | ||
4099 | } | ||
4100 | |||
4093 | pvr2_trace(PVR2_TRACE_INIT,"cpureset_assert(%d)",val); | 4101 | pvr2_trace(PVR2_TRACE_INIT,"cpureset_assert(%d)",val); |
4094 | 4102 | ||
4095 | da[0] = val ? 0x01 : 0x00; | 4103 | da[0] = val ? 0x01 : 0x00; |
@@ -4103,6 +4111,8 @@ void pvr2_hdw_cpureset_assert(struct pvr2_hdw *hdw,int val) | |||
4103 | "cpureset_assert(%d) error=%d",val,ret); | 4111 | "cpureset_assert(%d) error=%d",val,ret); |
4104 | pvr2_hdw_render_useless(hdw); | 4112 | pvr2_hdw_render_useless(hdw); |
4105 | } | 4113 | } |
4114 | |||
4115 | kfree(da); | ||
4106 | } | 4116 | } |
4107 | 4117 | ||
4108 | 4118 | ||