Skip to content

Commit

Permalink
V4L/DVB (11652): au0828: fix kernel oops regression on USB disconnect.
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Devin Heitmueller <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Apr 29, 2009
1 parent d4dc673 commit fe78a49
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/video/au0828/au0828-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,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) {
Expand Down Expand Up @@ -222,6 +220,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);

Expand Down

0 comments on commit fe78a49

Please sign in to comment.