diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-06-06 19:43:39 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-06-21 18:31:12 +0200 |
commit | 9a7b2d1f0eb0a6b674726c9a9d77ce83fd0b27fe (patch) | |
tree | f2fd1bad0dcfd8600cccdd9e5619a4a3a6c4d5ae /drivers/media/video/pwc/pwc.h | |
parent | [media] MAINTAINERS: Add videobuf2 maintainers (diff) | |
download | linux-9a7b2d1f0eb0a6b674726c9a9d77ce83fd0b27fe.tar.xz linux-9a7b2d1f0eb0a6b674726c9a9d77ce83fd0b27fe.zip |
[media] pwc: better usb disconnect handling
Unplugging a pwc cam while an app has the /dev/video# node open leads
to an oops in pwc_video_close when the app closes the node, because
the disconnect handler has free-ed the pdev struct pwc_video_close
tries to use. Instead of adding some sort of bandaid for this.
fix it properly using the v4l2 core's new(ish) behavior of keeping the
v4l2_dev structure around until both unregister has been called, and
all file handles referring to it have been closed:
Embed the v4l2_dev structure in the pdev structure and define a v4l2 dev
release callback releasing the pdev structure (and thus also the embedded
v4l2 dev structure.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pwc/pwc.h')
-rw-r--r-- | drivers/media/video/pwc/pwc.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/pwc/pwc.h b/drivers/media/video/pwc/pwc.h index e947766337d6..083f8b15df73 100644 --- a/drivers/media/video/pwc/pwc.h +++ b/drivers/media/video/pwc/pwc.h @@ -162,9 +162,9 @@ struct pwc_imgbuf struct pwc_device { - struct video_device *vdev; + struct video_device vdev; - /* Pointer to our usb_device */ + /* Pointer to our usb_device, may be NULL after unplug */ struct usb_device *udev; int type; /* type of cam (645, 646, 675, 680, 690, 720, 730, 740, 750) */ |