<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/media/usb/tm6000, branch linux-4.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-03-03T15:44:17Z</updated>
<entry>
<title>media: tm6000: Fix memleak in tm6000_start_stream</title>
<updated>2021-03-03T15:44:17Z</updated>
<author>
<name>Dinghao Liu</name>
</author>
<published>2021-01-02T08:26:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19d542790b35398210cb0a8e1fb9874aa6ee654f'/>
<id>urn:sha1:19d542790b35398210cb0a8e1fb9874aa6ee654f</id>
<content type='text'>
[ Upstream commit 76aaf8a96771c16365b8510f1fb97738dc88026e ]

When usb_clear_halt() fails, dvb-&gt;bulk_urb-&gt;transfer_buffer
and dvb-&gt;bulk_urb should be freed just like when
usb_submit_urb() fails.

Fixes: 3169c9b26fffa ("V4L/DVB (12788): tm6000: Add initial DVB-T support")
Signed-off-by: Dinghao Liu &lt;dinghao.liu@zju.edu.cn&gt;
Signed-off-by: Hans Verkuil &lt;hverkuil-cisco@xs4all.nl&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+huawei@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>media: tm6000: double free if usb disconnect while streaming</title>
<updated>2019-09-21T05:12:46Z</updated>
<author>
<name>Sean Young</name>
</author>
<published>2019-08-13T16:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=996cfd1aea062c4b071f059da1e38729e1bdc9a8'/>
<id>urn:sha1:996cfd1aea062c4b071f059da1e38729e1bdc9a8</id>
<content type='text'>
commit 699bf94114151aae4dceb2d9dbf1a6312839dcae upstream.

The usb_bulk_urb will kfree'd on disconnect, so ensure the pointer is set
to NULL after each free.

stop stream
urb killing
urb buffer free
tm6000: got start feed request tm6000_start_feed
tm6000: got start stream request tm6000_start_stream
tm6000: pipe reset
tm6000: got start feed request tm6000_start_feed
tm6000: got start feed request tm6000_start_feed
tm6000: got start feed request tm6000_start_feed
tm6000: got start feed request tm6000_start_feed
tm6000: IR URB failure: status: -71, length 0
xhci_hcd 0000:00:14.0: ERROR unknown event type 37
xhci_hcd 0000:00:14.0: ERROR unknown event type 37
tm6000:  error tm6000_urb_received
usb 1-2: USB disconnect, device number 5
tm6000: disconnecting tm6000 #0
==================================================================
BUG: KASAN: use-after-free in dvb_fini+0x75/0x140 [tm6000_dvb]
Read of size 8 at addr ffff888241044060 by task kworker/2:0/22

CPU: 2 PID: 22 Comm: kworker/2:0 Tainted: G        W         5.3.0-rc4+ #1
Hardware name: LENOVO 20KHCTO1WW/20KHCTO1WW, BIOS N23ET65W (1.40 ) 07/02/2019
Workqueue: usb_hub_wq hub_event
Call Trace:
 dump_stack+0x9a/0xf0
 print_address_description.cold+0xae/0x34f
 __kasan_report.cold+0x75/0x93
 ? tm6000_fillbuf+0x390/0x3c0 [tm6000_alsa]
 ? dvb_fini+0x75/0x140 [tm6000_dvb]
 kasan_report+0xe/0x12
 dvb_fini+0x75/0x140 [tm6000_dvb]
 tm6000_close_extension+0x51/0x80 [tm6000]
 tm6000_usb_disconnect.cold+0xd4/0x105 [tm6000]
 usb_unbind_interface+0xe4/0x390
 device_release_driver_internal+0x121/0x250
 bus_remove_device+0x197/0x260
 device_del+0x268/0x550
 ? __device_links_no_driver+0xd0/0xd0
 ? usb_remove_ep_devs+0x30/0x3b
 usb_disable_device+0x122/0x400
 usb_disconnect+0x153/0x430
 hub_event+0x800/0x1e40
 ? trace_hardirqs_on_thunk+0x1a/0x20
 ? hub_port_debounce+0x1f0/0x1f0
 ? retint_kernel+0x10/0x10
 ? lock_is_held_type+0xf1/0x130
 ? hub_port_debounce+0x1f0/0x1f0
 ? process_one_work+0x4ae/0xa00
 process_one_work+0x4ba/0xa00
 ? pwq_dec_nr_in_flight+0x160/0x160
 ? do_raw_spin_lock+0x10a/0x1d0
 worker_thread+0x7a/0x5c0
 ? process_one_work+0xa00/0xa00
 kthread+0x1d5/0x200
 ? kthread_create_worker_on_cpu+0xd0/0xd0
 ret_from_fork+0x3a/0x50

Allocated by task 2682:
 save_stack+0x1b/0x80
 __kasan_kmalloc.constprop.0+0xc2/0xd0
 usb_alloc_urb+0x28/0x60
 tm6000_start_feed+0x10a/0x300 [tm6000_dvb]
 dmx_ts_feed_start_filtering+0x86/0x120 [dvb_core]
 dvb_dmxdev_start_feed+0x121/0x180 [dvb_core]
 dvb_dmxdev_filter_start+0xcb/0x540 [dvb_core]
 dvb_demux_do_ioctl+0x7ed/0x890 [dvb_core]
 dvb_usercopy+0x97/0x1f0 [dvb_core]
 dvb_demux_ioctl+0x11/0x20 [dvb_core]
 do_vfs_ioctl+0x5d8/0x9d0
 ksys_ioctl+0x5e/0x90
 __x64_sys_ioctl+0x3d/0x50
 do_syscall_64+0x74/0xe0
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 22:
 save_stack+0x1b/0x80
 __kasan_slab_free+0x12c/0x170
 kfree+0xfd/0x3a0
 xhci_giveback_urb_in_irq+0xfe/0x230
 xhci_td_cleanup+0x276/0x340
 xhci_irq+0x1129/0x3720
 __handle_irq_event_percpu+0x6e/0x420
 handle_irq_event_percpu+0x6f/0x100
 handle_irq_event+0x55/0x84
 handle_edge_irq+0x108/0x3b0
 handle_irq+0x2e/0x40
 do_IRQ+0x83/0x1a0

Cc: stable@vger.kernel.org
Signed-off-by: Sean Young &lt;sean@mess.org&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>media: tm6000: add error handling for dvb_register_adapter</title>
<updated>2018-10-10T06:52:06Z</updated>
<author>
<name>Zhouyang Jia</name>
</author>
<published>2018-06-11T04:39:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5a816f1495a54e813aff70b6b2abcbf0e1b65f12'/>
<id>urn:sha1:5a816f1495a54e813aff70b6b2abcbf0e1b65f12</id>
<content type='text'>
[ Upstream commit e95d7c6eb94c634852eaa5ff4caf3db05b5d2e86 ]

When dvb_register_adapter fails, the lack of error-handling code may
cause unexpected results.

This patch adds error-handling code after calling dvb_register_adapter.

Signed-off-by: Zhouyang Jia &lt;jiazhouyang09@gmail.com&gt;
[hans.verkuil@cisco.com: use pr_err and fix typo: adater -&gt; adapter]
Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>[media] cx25821, cx88, tm6000: use SNDRV_DEFAULT_ENABLE_PNP</title>
<updated>2015-10-01T11:42:52Z</updated>
<author>
<name>Luis de Bethencourt</name>
</author>
<published>2015-09-21T16:00:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d275d935900e10f01f2e43fb4a961ebcb48867bc'/>
<id>urn:sha1:d275d935900e10f01f2e43fb4a961ebcb48867bc</id>
<content type='text'>
Instead of manually initializing the bool array enable, use the
SNDRV_DEFAULT_ENABLE_PNP macro. As most drivers do.

Signed-off-by: Luis de Bethencourt &lt;luisbg@osg.samsung.com&gt;
Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>[media] usb drivers: use BUG_ON() instead of if () BUG</title>
<updated>2015-06-09T21:30:09Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
</author>
<published>2015-05-19T11:00:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=09f2082e23ad8e89e10152b8701d3511ace45290'/>
<id>urn:sha1:09f2082e23ad8e89e10152b8701d3511ace45290</id>
<content type='text'>
Some USB drivers have a logic at the VB buffer handling like:
	if (in_interrupt())
		BUG();
Use, instead:
	BUG_ON(in_interrupt());

Btw, this logic looks weird on my eyes. We should convert them
to use VB2, in order to avoid those crappy things.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
Acked-by: Lad, Prabhakar &lt;prabhakar.csengg@gmail.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>[media] tm6000: remove needless check</title>
<updated>2015-06-05T14:26:37Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
</author>
<published>2015-06-05T12:33:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=485bdbb6b83309505654379153d55746d5996917'/>
<id>urn:sha1:485bdbb6b83309505654379153d55746d5996917</id>
<content type='text'>
Smatch reports a warning:
	drivers/media/usb/tm6000/tm6000-video.c:646 tm6000_prepare_isoc() error: we previously assumed 'dev-&gt;urb_buffer' could be null (see line 624)

This is not really a problem, but it actually shows that the check
if urb_buffer is NULL is being done twice: at the if and at
tm6000_alloc_urb_buffers().

We don't need to do it twice. So, remove the extra check. The code
become cleaner, and, as a collateral effect, smatch becomes happy.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>[media] tm6000: embed video_device</title>
<updated>2015-04-03T02:49:49Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2015-03-09T16:34:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65b88c0be1f3fff0c652db19d5e13d8448764cf5'/>
<id>urn:sha1:65b88c0be1f3fff0c652db19d5e13d8448764cf5</id>
<content type='text'>
Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>[media] media: drivers shouldn't touch debug field in video_device</title>
<updated>2014-12-23T12:29:04Z</updated>
<author>
<name>Hans Verkuil</name>
</author>
<published>2014-12-01T13:10:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21a7e0596a63abdf12a9591c29359f7f15e18c16'/>
<id>urn:sha1:21a7e0596a63abdf12a9591c29359f7f15e18c16</id>
<content type='text'>
The debug field in struct video_device is for internal use only and
drivers should mix that with their own debug module options.

It is handled by the V4L2 core and users can set it using
/sys/class/video4linux/&lt;devX&gt;/debug.

It has been deprecated for some time now, so it is time to remove it
completely from the drivers.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@osg.samsung.com&gt;
</content>
</entry>
<entry>
<title>[media] rc-core: rename dev-&gt;scanmask to dev-&gt;scancode_mask</title>
<updated>2014-07-25T22:10:43Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2014-04-03T23:32:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d2f1d3cdedd4d3efff8d14f1f49cf73e2f5cc36'/>
<id>urn:sha1:9d2f1d3cdedd4d3efff8d14f1f49cf73e2f5cc36</id>
<content type='text'>
We already have dev-&gt;scancode_filter and dev-&gt;scancode_wakeup_filter
so rename dev-&gt;scanmask to dev-&gt;scancode_mask for consistency.

Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;m.chehab@samsung.com&gt;
</content>
</entry>
<entry>
<title>[media] rc-core: remove protocol arrays</title>
<updated>2014-07-25T22:10:43Z</updated>
<author>
<name>David Härdeman</name>
</author>
<published>2014-04-03T23:32:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c5540fbb9de39ceec108a889133664a887c2f55a'/>
<id>urn:sha1:c5540fbb9de39ceec108a889133664a887c2f55a</id>
<content type='text'>
The basic API of rc-core used to be:

	dev = rc_allocate_device();
	dev-&gt;x = a;
	dev-&gt;y = b;
	dev-&gt;z = c;
	rc_register_device();

which is a pretty common pattern in the kernel, after the introduction of
protocol arrays the API looks something like:

	dev = rc_allocate_device();
	dev-&gt;x = a;
	rc_set_allowed_protocols(dev, RC_BIT_X);
	dev-&gt;z = c;
	rc_register_device();

There's no real need for the protocols to be an array, so change it
back to be consistent (and in preparation for the following patches).

[m.chehab@samsung.com: added missing changes at some files]
Signed-off-by: David Härdeman &lt;david@hardeman.nu&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;m.chehab@samsung.com&gt;
</content>
</entry>
</feed>
