[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190519194858.2bojwep7monfytk2@gofer.mess.org>
Date: Sun, 19 May 2019 20:48:58 +0100
From: Sean Young <sean@...s.org>
To: syzbot <syzbot+357d86bcb4cca1a2f572@...kaller.appspotmail.com>
Cc: andreyknvl@...gle.com, linux-kernel@...r.kernel.org,
linux-media@...r.kernel.org, linux-usb@...r.kernel.org,
mchehab@...nel.org, syzkaller-bugs@...glegroups.com
Subject: [PATCH] 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@...kaller.appspotmail.com
Signed-off-by: Sean Young <sean@...s.org>
---
drivers/media/usb/au0828/au0828-core.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c
index 925a80437822..e306d5d5bebb 100644
--- a/drivers/media/usb/au0828/au0828-core.c
+++ b/drivers/media/usb/au0828/au0828-core.c
@@ -729,6 +729,12 @@ static int au0828_usb_probe(struct usb_interface *interface,
/* Setup */
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 */
retval = au0828_analog_register(dev, interface);
if (retval) {
@@ -747,12 +753,6 @@ static int au0828_usb_probe(struct usb_interface *interface,
/* Remote controller */
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",
dev->board.name == NULL ? "Unset" : dev->board.name);
--
2.20.1
Powered by blists - more mailing lists