aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Dillow <dave@thedillows.org>2012-06-17 23:15:21 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 18:36:28 -0400
commita7deca6fa79d5c65575532e780f3c93f6bf8ddad (patch)
tree2754964d70a7ecba43a7a312d246176795f4e34a
parent4dab0e5fe8ceaaf267003b5d7aa0c31c1092bee0 (diff)
[media] cx231xx: don't DMA to random addresses
Commit 7a6f6c29d264cdd2fe0eb3d923217eed5f0ad134 (cx231xx: use URB_NO_TRANSFER_DMA_MAP) was intended to avoid mapping the DMA buffer for URB twice. This works for the URBs allocated with usb_alloc_urb(), as those are allocated from cohernent DMA pools, but the flag was also added for the VBI and audio URBs, which have a manually allocated area. This leaves the random trash in the structure after allocation as the DMA address, corrupting memory and preventing VBI and audio from working. Letting the USB core map the buffers solves the problem. Cc: stable@kernel.org Signed-off-by: David Dillow <dave@thedillows.org> Cc: Sri Deevi <srinivasa.deevi@conexant.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cx231xx/cx231xx-audio.c4
-rw-r--r--drivers/media/video/cx231xx/cx231xx-vbi.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-audio.c b/drivers/media/video/cx231xx/cx231xx-audio.c
index 068f78dc5d13..b4c99c7270cf 100644
--- a/drivers/media/video/cx231xx/cx231xx-audio.c
+++ b/drivers/media/video/cx231xx/cx231xx-audio.c
@@ -307,7 +307,7 @@ static int cx231xx_init_audio_isoc(struct cx231xx *dev)
307 urb->context = dev; 307 urb->context = dev;
308 urb->pipe = usb_rcvisocpipe(dev->udev, 308 urb->pipe = usb_rcvisocpipe(dev->udev,
309 dev->adev.end_point_addr); 309 dev->adev.end_point_addr);
310 urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; 310 urb->transfer_flags = URB_ISO_ASAP;
311 urb->transfer_buffer = dev->adev.transfer_buffer[i]; 311 urb->transfer_buffer = dev->adev.transfer_buffer[i];
312 urb->interval = 1; 312 urb->interval = 1;
313 urb->complete = cx231xx_audio_isocirq; 313 urb->complete = cx231xx_audio_isocirq;
@@ -368,7 +368,7 @@ static int cx231xx_init_audio_bulk(struct cx231xx *dev)
368 urb->context = dev; 368 urb->context = dev;
369 urb->pipe = usb_rcvbulkpipe(dev->udev, 369 urb->pipe = usb_rcvbulkpipe(dev->udev,
370 dev->adev.end_point_addr); 370 dev->adev.end_point_addr);
371 urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; 371 urb->transfer_flags = 0;
372 urb->transfer_buffer = dev->adev.transfer_buffer[i]; 372 urb->transfer_buffer = dev->adev.transfer_buffer[i];
373 urb->complete = cx231xx_audio_bulkirq; 373 urb->complete = cx231xx_audio_bulkirq;
374 urb->transfer_buffer_length = sb_size; 374 urb->transfer_buffer_length = sb_size;
diff --git a/drivers/media/video/cx231xx/cx231xx-vbi.c b/drivers/media/video/cx231xx/cx231xx-vbi.c
index 3d15314e1f88..ac7db52f404f 100644
--- a/drivers/media/video/cx231xx/cx231xx-vbi.c
+++ b/drivers/media/video/cx231xx/cx231xx-vbi.c
@@ -448,7 +448,7 @@ int cx231xx_init_vbi_isoc(struct cx231xx *dev, int max_packets,
448 return -ENOMEM; 448 return -ENOMEM;
449 } 449 }
450 dev->vbi_mode.bulk_ctl.urb[i] = urb; 450 dev->vbi_mode.bulk_ctl.urb[i] = urb;
451 urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; 451 urb->transfer_flags = 0;
452 452
453 dev->vbi_mode.bulk_ctl.transfer_buffer[i] = 453 dev->vbi_mode.bulk_ctl.transfer_buffer[i] =
454 kzalloc(sb_size, GFP_KERNEL); 454 kzalloc(sb_size, GFP_KERNEL);