summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/au0828
diff options
context:
space:
mode:
authorDevin Heitmueller <dheitmueller@linuxtv.org>2009-04-28 12:14:07 -0400
committerDevin Heitmueller <dheitmueller@linuxtv.org>2009-04-28 12:14:07 -0400
commit2af675418bb28b6297dfe4d592589fcd7a9410f6 (patch)
tree9dcec89c82b01dbb519f05e56fe739c06db38ba6 /linux/drivers/media/video/au0828
parent34efc2efeab79b43139454c4daeef94ff1b69f2c (diff)
downloadmediapointer-dvb-s2-2af675418bb28b6297dfe4d592589fcd7a9410f6.tar.gz
mediapointer-dvb-s2-2af675418bb28b6297dfe4d592589fcd7a9410f6.tar.bz2
au0828: fix kernel oops regression on USB disconnect.
From: Devin Heitmueller <dheitmueller@linuxtv.org> A regression was introduced in hg changeset 33810c734a0d, which resulted in a kernel panic whenever the device was disconnected from USB. The call to 4l2_device_register() was overwriting the pointer for usb_set_intfdata(), so when au0828_usb_disconnect() was called, the usb_get_intfdata() returned a pointer to the v4l2_device instead of the au0828_dev structure. Priority: high Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/video/au0828')
-rw-r--r--linux/drivers/media/video/au0828/au0828-core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/linux/drivers/media/video/au0828/au0828-core.c b/linux/drivers/media/video/au0828/au0828-core.c
index ab25af430..4da5b7909 100644
--- a/linux/drivers/media/video/au0828/au0828-core.c
+++ b/linux/drivers/media/video/au0828/au0828-core.c
@@ -193,8 +193,6 @@ static int au0828_usb_probe(struct usb_interface *interface,
dev->usbdev = usbdev;
dev->boardnr = id->driver_info;
- usb_set_intfdata(interface, dev);
-
/* Create the v4l2_device */
retval = v4l2_device_register(&interface->dev, &dev->v4l2_dev);
if (retval) {
@@ -223,6 +221,10 @@ static int au0828_usb_probe(struct usb_interface *interface,
/* Digital TV */
au0828_dvb_register(dev);
+ /* Store the pointer to the au0828_dev so it can be accessed in
+ au0828_usb_disconnect */
+ usb_set_intfdata(interface, dev);
+
printk(KERN_INFO "Registered device AU0828 [%s]\n",
dev->board.name == NULL ? "Unset" : dev->board.name);