Commit 6d0d1ff9 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

media: au0828: fix null dereference in error path

au0828_usb_disconnect() gets the au0828_dev struct via usb_get_intfdata,
so it needs to set up for the error paths.

Reported-by: syzbot+357d86bcb4cca1a2f572@syzkaller.appspotmail.com
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 6cf97230
...@@ -729,6 +729,12 @@ static int au0828_usb_probe(struct usb_interface *interface, ...@@ -729,6 +729,12 @@ static int au0828_usb_probe(struct usb_interface *interface,
/* Setup */ /* Setup */
au0828_card_setup(dev); au0828_card_setup(dev);
/*
* Store the pointer to the au0828_dev so it can be accessed in
* au0828_usb_disconnect
*/
usb_set_intfdata(interface, dev);
/* Analog TV */ /* Analog TV */
retval = au0828_analog_register(dev, interface); retval = au0828_analog_register(dev, interface);
if (retval) { if (retval) {
...@@ -747,12 +753,6 @@ static int au0828_usb_probe(struct usb_interface *interface, ...@@ -747,12 +753,6 @@ static int au0828_usb_probe(struct usb_interface *interface,
/* Remote controller */ /* Remote controller */
au0828_rc_register(dev); au0828_rc_register(dev);
/*
* Store the pointer to the au0828_dev so it can be accessed in
* au0828_usb_disconnect
*/
usb_set_intfdata(interface, dev);
pr_info("Registered device AU0828 [%s]\n", pr_info("Registered device AU0828 [%s]\n",
dev->board.name == NULL ? "Unset" : dev->board.name); dev->board.name == NULL ? "Unset" : dev->board.name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment