Skip to content

Commit

Permalink
[media] saa7134: Fix crash when device is closed before streamoff
Browse files Browse the repository at this point in the history
pm_qos_remove_request was not called on video_release, resulting in the PM
core's list of requests being corrupted when the file handle was freed.
This has no immediate symptoms, but later in operation, the kernel will
panic as the PM core dereferences a dangling pointer.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
  • Loading branch information
Simon Farnsworth authored and Mauro Carvalho Chehab committed Oct 14, 2013
1 parent f527b17 commit 9c9cff5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/pci/saa7134/saa7134-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ static int video_release(struct file *file)

/* stop video capture */
if (res_check(fh, RESOURCE_VIDEO)) {
pm_qos_remove_request(&dev->qos_request);
videobuf_streamoff(&fh->cap);
res_free(dev,fh,RESOURCE_VIDEO);
}
Expand Down

0 comments on commit 9c9cff5

Please sign in to comment.