From: Hans Verkuil <hverkuil@xs4all.nl>
To: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Cc: linux-media@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] saa7134: Fix crash when device is closed before streamoff
Date: Mon, 30 Sep 2013 14:19:48 +0200 [thread overview]
Message-ID: <52496C64.8090606@xs4all.nl> (raw)
In-Reply-To: <1379697328-9990-1-git-send-email-simon.farnsworth@onelan.co.uk>
On 09/20/2013 07:15 PM, Simon Farnsworth wrote:
> 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>
> Cc: stable@vger.kernel.org
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Regards,
Hans
> ---
>
> I didn't notice this when I first implemented the pm_qos_request as the
> userspace I was using always called streamoff before closing the
> device. I've since changed userspace components, and hit the kernel panic.
>
> drivers/media/pci/saa7134/saa7134-video.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
> index e12bbd8..fb60da8 100644
> --- a/drivers/media/pci/saa7134/saa7134-video.c
> +++ b/drivers/media/pci/saa7134/saa7134-video.c
> @@ -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);
> }
>
parent reply other threads:[~2013-09-30 12:19 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1379697328-9990-1-git-send-email-simon.farnsworth@onelan.co.uk>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52496C64.8090606@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=simon.farnsworth@onelan.co.uk \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.