From: Laurent Pinchart Date: Tue, 27 Mar 2012 08:51:00 +0000 (-0300) Subject: [media] uvcvideo: Fix race-related crash in uvc_video_clock_update() X-Git-Tag: v3.4-rc3~42^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed0ee0ce0a3224dab5caa088a5f8b6df25924276;p=pandora-kernel.git [media] uvcvideo: Fix race-related crash in uvc_video_clock_update() The driver frees the clock samples buffer before stopping the video buffers queue. If a DQBUF call arrives in-between, uvc_video_clock_update() will be called with a NULL clock samples buffer, leading to a crash. This occurs very frequently when using the webcam with the flash browser plugin. Move clock initialization/cleanup to uvc_video_enable() in order to free the clock samples buffer after the queue is stopped. Make sure the clock is reset at resume time to avoid miscalculating timestamps. Signed-off-by: Laurent Pinchart Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed