diff options
author | Florian Mickler <florian@mickler.org> | 2011-03-21 14:33:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 08:27:58 -0400 |
commit | b47b850116369a474f71c8ee1e7d06dfa9bf5468 (patch) | |
tree | 432c834753aec851234616c7467d920eca20c4c6 /drivers/media/dvb/dvb-usb/dw2102.c | |
parent | 0e4e7208e6b33816c457292ee771da3a5779027b (diff) |
[media] dw2102: get rid of on-stack dma buffer
usb_control_msg initiates (and waits for completion of) a dma transfer using
the supplied buffer. That buffer thus has to be seperately allocated on
the heap.
In lib/dma_debug.c the function check_for_stack even warns about it:
WARNING: at lib/dma-debug.c:866 check_for_stack
Note: This change is tested to compile only, as I don't have the hardware.
Signed-off-by: Florian Mickler <florian@mickler.org>
Cc: Igor M. Liplianin <liplianin@tut.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dw2102.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/dw2102.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/dvb/dvb-usb/dw2102.c b/drivers/media/dvb/dvb-usb/dw2102.c index f5b9da18f611..5aabfbcb545b 100644 --- a/drivers/media/dvb/dvb-usb/dw2102.c +++ b/drivers/media/dvb/dvb-usb/dw2102.c | |||
@@ -121,12 +121,16 @@ static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value, | |||
121 | u16 index, u8 * data, u16 len, int flags) | 121 | u16 index, u8 * data, u16 len, int flags) |
122 | { | 122 | { |
123 | int ret; | 123 | int ret; |
124 | u8 u8buf[len]; | 124 | u8 *u8buf; |
125 | |||
126 | unsigned int pipe = (flags == DW210X_READ_MSG) ? | 125 | unsigned int pipe = (flags == DW210X_READ_MSG) ? |
127 | usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0); | 126 | usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0); |
128 | u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT; | 127 | u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT; |
129 | 128 | ||
129 | u8buf = kmalloc(len, GFP_KERNEL); | ||
130 | if (!u8buf) | ||
131 | return -ENOMEM; | ||
132 | |||
133 | |||
130 | if (flags == DW210X_WRITE_MSG) | 134 | if (flags == DW210X_WRITE_MSG) |
131 | memcpy(u8buf, data, len); | 135 | memcpy(u8buf, data, len); |
132 | ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR, | 136 | ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR, |
@@ -134,6 +138,8 @@ static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value, | |||
134 | 138 | ||
135 | if (flags == DW210X_READ_MSG) | 139 | if (flags == DW210X_READ_MSG) |
136 | memcpy(data, u8buf, len); | 140 | memcpy(data, u8buf, len); |
141 | |||
142 | kfree(u8buf); | ||
137 | return ret; | 143 | return ret; |
138 | } | 144 | } |
139 | 145 | ||