diff options
author | Jean-François Moine <moinejf@free.fr> | 2010-07-06 03:32:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-02 15:42:48 -0400 |
commit | f7059eaa285c0460569ffd26c43ae07e3f03cd6c (patch) | |
tree | 4f31450a63b1460fcdf3b79e8f47d8b824683a60 /drivers/media/video/gspca/m5602 | |
parent | 02bbcb9d863df10b5a4b91ba5b4c76eaf1340883 (diff) |
V4L/DVB: gspca - main: Don't use the frame buffer flags
This patch fixes possible race conditions in queue management with SMP:
when a frame was completed, the irq function tried to use the next frame
buffer. At this time, it was possible that the application on an other
processor updated the frame pointer, making the image to point to a bad
buffer.
The patch contains two main changes:
- the image transfer uses the queue indexes which are protected against
simultaneous memory access,
- the image pointer which is used for image concatenation is only set at
interrupt level.
Some subdrivers which used the image pointer have been updated.
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-François Moine <moinejf@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/m5602')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_core.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_core.c b/drivers/media/video/gspca/m5602/m5602_core.c index 0c4ad5a5642a..b073d66acd04 100644 --- a/drivers/media/video/gspca/m5602/m5602_core.c +++ b/drivers/media/video/gspca/m5602/m5602_core.c | |||
@@ -307,11 +307,6 @@ static void m5602_urb_complete(struct gspca_dev *gspca_dev, | |||
307 | } else { | 307 | } else { |
308 | int cur_frame_len; | 308 | int cur_frame_len; |
309 | 309 | ||
310 | if (gspca_dev->image == NULL) { | ||
311 | gspca_dev->last_packet_type = DISCARD_PACKET; | ||
312 | return; | ||
313 | } | ||
314 | |||
315 | cur_frame_len = gspca_dev->image_len; | 310 | cur_frame_len = gspca_dev->image_len; |
316 | /* Remove urb header */ | 311 | /* Remove urb header */ |
317 | data += 4; | 312 | data += 4; |