diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2019-08-15 08:40:52 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-08-19 11:08:06 -0400 |
commit | 0d616f2a3fdbf1304db44d451d9f07008556923b (patch) | |
tree | 762d013aae2471f9fa245c05bf140fcd9b6c039b | |
parent | 3cec570b6d9c371bef1688a00ceb039aa4221fb7 (diff) |
media: radio/si470x: kill urb on error
In the probe() function radio->int_in_urb was not killed if an
error occurred in the probe sequence. It was also missing in
the disconnect.
This caused this syzbot issue:
https://syzkaller.appspot.com/bug?extid=2d4fc2a0c45ad8da7e99
Reported-and-tested-by: syzbot+2d4fc2a0c45ad8da7e99@syzkaller.appspotmail.com
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r-- | drivers/media/radio/si470x/radio-si470x-usb.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-usb.c b/drivers/media/radio/si470x/radio-si470x-usb.c index 49073747b1e7..fedff68d8c49 100644 --- a/drivers/media/radio/si470x/radio-si470x-usb.c +++ b/drivers/media/radio/si470x/radio-si470x-usb.c | |||
@@ -734,7 +734,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, | |||
734 | /* start radio */ | 734 | /* start radio */ |
735 | retval = si470x_start_usb(radio); | 735 | retval = si470x_start_usb(radio); |
736 | if (retval < 0) | 736 | if (retval < 0) |
737 | goto err_all; | 737 | goto err_buf; |
738 | 738 | ||
739 | /* set initial frequency */ | 739 | /* set initial frequency */ |
740 | si470x_set_freq(radio, 87.5 * FREQ_MUL); /* available in all regions */ | 740 | si470x_set_freq(radio, 87.5 * FREQ_MUL); /* available in all regions */ |
@@ -749,6 +749,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, | |||
749 | 749 | ||
750 | return 0; | 750 | return 0; |
751 | err_all: | 751 | err_all: |
752 | usb_kill_urb(radio->int_in_urb); | ||
753 | err_buf: | ||
752 | kfree(radio->buffer); | 754 | kfree(radio->buffer); |
753 | err_ctrl: | 755 | err_ctrl: |
754 | v4l2_ctrl_handler_free(&radio->hdl); | 756 | v4l2_ctrl_handler_free(&radio->hdl); |
@@ -822,6 +824,7 @@ static void si470x_usb_driver_disconnect(struct usb_interface *intf) | |||
822 | mutex_lock(&radio->lock); | 824 | mutex_lock(&radio->lock); |
823 | v4l2_device_disconnect(&radio->v4l2_dev); | 825 | v4l2_device_disconnect(&radio->v4l2_dev); |
824 | video_unregister_device(&radio->videodev); | 826 | video_unregister_device(&radio->videodev); |
827 | usb_kill_urb(radio->int_in_urb); | ||
825 | usb_set_intfdata(intf, NULL); | 828 | usb_set_intfdata(intf, NULL); |
826 | mutex_unlock(&radio->lock); | 829 | mutex_unlock(&radio->lock); |
827 | v4l2_device_put(&radio->v4l2_dev); | 830 | v4l2_device_put(&radio->v4l2_dev); |