[media] omap3isp: video: Avoid crashes when pipeline set stream operation fails
commit5b6c3ef0e43fe80b517735697e4d0fb5729b2ab4
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sat, 13 Aug 2011 16:13:32 +0000 (13 13:13 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 21 Sep 2011 18:30:13 +0000 (21 15:30 -0300)
tree6d9f1935fa7c07c34628aee489280521457ad975
parentc62e2a19d2b8c884c6f3ab3bb29d6fde2e13d8ac
[media] omap3isp: video: Avoid crashes when pipeline set stream operation fails

If streaming can't be enabled on the pipeline, the DMA buffers queue is
not emptied. If the buffers then get freed the queue will end up
referencing free memory. This is usually not an issue, as the DMA queue
will be reinitialized the next time streaming is enabled, before
enabling the hardware.

However, if the sensor connected at the pipeline input is free-running,
the CCDC will start generating interrupts as soon as it gets powered up,
before the streaming gets enabled on the hardware. This will make the
CCDC interrupt handler access freed memory, causing a crash.

Reinitialize the DMA buffers queue in isp_video_streamon() if the error
path to make sure this situation won't happen.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/omap3isp/ispvideo.c