History log of /linux-master/drivers/media/usb/usbtv/usbtv-core.c
Revision Date Author Comments
# 91f13120 16-Mar-2023 Oliver Neukum <oneukum@suse.com>

usbtv: usbtv_set_regs: the pipe is output

We are setting a value. That is output and
the pipe has to match that.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


# bf65f8aa 24-Sep-2020 Oliver Neukum <oneukum@suse.com>

media: usbtv: Fix refcounting mixup

The premature free in the error path is blocked by V4L
refcounting, not USB refcounting. Thanks to
Ben Hutchings for review.

[v2] corrected attributions

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Fixes: 50e704453553 ("media: usbtv: prevent double free in error case")
CC: stable@vger.kernel.org
Reported-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 536f561d 13-Jan-2020 Johan Hovold <johan@kernel.org>

media: usbtv: fix control-message timeouts

The driver was issuing synchronous uninterruptible control requests
without using a timeout. This could lead to the driver hanging on
various user requests due to a malfunctioning (or malicious) device
until the device is physically disconnected.

The USB upper limit of five seconds per request should be more than
enough.

Fixes: f3d27f34fdd7 ("[media] usbtv: Add driver for Fushicai USBTV007 video frame grabber")
Fixes: c53a846c48f2 ("[media] usbtv: add video controls")
Cc: stable <stable@vger.kernel.org> # 3.11
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Lubomir Rintel <lkundrak@v3.sk>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


# 8a695a6c 14-Jan-2018 Ian Douglas Scott <ian@iandouglasscott.com>

media: usbtv: Add USB ID 1f71:3306 to the UTV007 driver

Add support for a new USB ID in this driver.

Signed-off-by: Ian Douglas Scott <ian@iandouglasscott.com>
[hans.verkuil@cisco.com: add commit message]
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 50e70445 08-Jan-2018 Oliver Neukum <oneukum@suse.com>

media: usbtv: prevent double free in error case

Quoting the original report:

It looks like there is a double-free vulnerability in Linux usbtv driver
on an error path of usbtv_probe function. When audio registration fails,
usbtv_video_free function ends up freeing usbtv data structure, which
gets freed the second time under usbtv_video_fail label.

usbtv_audio_fail:

usbtv_video_free(usbtv); =>

v4l2_device_put(&usbtv->v4l2_dev);

=> v4l2_device_put

=> kref_put

=> v4l2_device_release

=> usbtv_release (CALLBACK)

=> kfree(usbtv) (1st time)

usbtv_video_fail:

usb_set_intfdata(intf, NULL);

usb_put_dev(usbtv->udev);

kfree(usbtv); (2nd time)

So, as we have refcounting, use it

Reported-by: Yavuz, Tuba <tuba@ece.ufl.edu>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
CC: stable@vger.kernel.org
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 04226916 16-Apr-2017 Icenowy Zheng <icenowy@aosc.io>

media: usbtv: add a new usbid

A new usbid of UTV007 is found in a newly bought device.

The usbid is 1f71:3301.

The ID on the chip is:
UTV007
A89029.1
1520L18K1

Both video and audio is tested with the modified usbtv driver.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Acked-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 6981d6e5 20-Oct-2017 Jaejoong Kim <climbbb.kim@gmail.com>

media: usb: usbtv: remove duplicate & operation

usb_endpoint_maxp() has an inline keyword and searches for bits[10:0]
by & operation with 0x7ff. So, we can remove the duplicate & operation
with 0x7ff.

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 7fb2e072 13-Aug-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

media: usb: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

'drivers/media/usb/b2c2/flexcop-usb.c' Fix checkpatch.pl error:
ERROR: space prohibited before open square bracket '['.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# b72b7979 28-Sep-2016 Felipe Balbi <felipe.balbi@linux.intel.com>

media: usbtv: core: make use of new usb_endpoint_maxp_mult()

We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: <linux-media@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>


# 5ae1e2b2 01-Jun-2016 Lubomir Rintel <lkundrak@v3.sk>

[media] usbtv: clarify the licensing

OpenBSD would like to reuse some code but consider the licensing not
clear enough. Let's clarify it a bit so that it suits their conventions:

1.) Keep the "extra text" away from the copyright statement and the
rights grant.

2.) Add the warranty disclaimer -- it should not be legally required,
nevertheless the clause 1. of the rights grant refest to it.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>


# 146af9cb 19-Sep-2014 Amber Thrall <amber.rose.thrall@gmail.com>

[media] Media: USB: usbtv: Fixed all coding style issues in usbtv source files

Fixed various coding styles, ignoring coding style error on line 5 for all files containing a link that is longer than 80 characters long.

Signed-off-by: Amber Thrall <amber.rose.thrall@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>


# 63ddf68d 11-Aug-2014 Federico Simoncelli <fsimonce@redhat.com>

[media] usbtv: add audio support

Add an ALSA handler inside usbtv module, in order to make
audio to work with those devices.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# ebdae650 23-May-2014 Alexey Khoroshilov <khoroshilov@ispras.ru>

[media] usbtv: fix leak at failure path in usbtv_probe()

Error handling code in usbtv_probe() misses usb_put_dev().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 9b058373 04-Feb-2014 Fengguang Wu <fengguang.wu@intel.com>

[media] drivers/media/usb/usbtv/usbtv-core.c:119:22: sparse: symbol 'usbtv_id_table' was not declared. Should it be static?

tree: git://linuxtv.org/media_tree.git master
head: a3550ea665acd1922df8275379028c1634675629
commit: a3550ea665acd1922df8275379028c1634675629 [499/499] [media] usbtv: split core and video implementation
reproduce: make C=1 CF=-D__CHECK_ENDIAN__

sparse warnings: (new ones prefixed by >>)

>> drivers/media/usb/usbtv/usbtv-core.c:119:22: sparse: symbol 'usbtv_id_table' was not declared. Should it be static?
>> drivers/media/usb/usbtv/usbtv-core.c:129:19: sparse: symbol 'usbtv_usb_driver' was not declared. Should it be static?

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# 9fd9330c 04-Feb-2014 Hans Verkuil <hverkuil@xs4all.nl>

[media] usbtv: fix compiler error due to missing module.h

usbtv-video.c needs module.h. So move the module.h include from usbtv-core.c to usbtv.h,
that way both core.c and video.c have it.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>


# a3550ea6 07-Jan-2014 Federico Simoncelli <fsimonce@redhat.com>

[media] usbtv: split core and video implementation

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>