summaryrefslogtreecommitdiff
path: root/drivers/media/usb/gspca/sonixb.c
AgeCommit message (Collapse)Author
2019-08-19media: gspca: zero usb_buf on errorHans Verkuil
If reg_r() fails, then gspca_dev->usb_buf was left uninitialized, and some drivers used the contents of that buffer in logic. This caused several syzbot errors: https://syzkaller.appspot.com/bug?extid=397fd082ce5143e2f67d https://syzkaller.appspot.com/bug?extid=1a35278dd0ebfb3a038a https://syzkaller.appspot.com/bug?extid=06ddf1788cfd048c5e82 I analyzed the gspca drivers and zeroed the buffer where needed. Reported-and-tested-by: syzbot+1a35278dd0ebfb3a038a@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+397fd082ce5143e2f67d@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+06ddf1788cfd048c5e82@syzkaller.appspotmail.com Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-21treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 24Thomas Gleixner
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 50 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154042.917228456@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-01media: usb: fix several typosMauro Carvalho Chehab
Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2017-01-27[media] media: Drop FSF's postal address from the source code filesSakari Ailus
Drop the FSF's postal address from the source code files that typically contain mostly the license text. Of the 628 removed instances, 578 are outdated. The patch has been created with the following command without manual edits: git grep -l "675 Mass Ave\|59 Temple Place\|51 Franklin St" -- \ drivers/media/ include/media|while read i; do i=$i perl -e ' open(F,"< $ENV{i}"); $a=join("", <F>); $a =~ s/[ \t]*\*\n.*You should.*\n.*along with.*\n.*(\n.*USA.*$)?\n//m && $a =~ s/(^.*)Or, (point your browser to) /$1To obtain the license, $2\n$1/m; close(F); open(F, "> $ENV{i}"); print F $a; close(F);'; done Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
2014-07-17[media] Fix 64-bit division fall-out from 64-bit control rangesHans Verkuil
Commit 0ba2aeb6dab80920edd9cf5b93b1ea4d6913b8f3 increased the internal control ranges to 64 bit, but that caused problems in drivers that use the minimum/maximum/step/default_value control values in a division or modulus operations since not all architectures support those natively. Luckily, in almost all cases it is possible to just cast to 32 bits (the control value is known to be 32 bits, so it is safe to cast). Only in v4l2-ctrls.c was it necessary to use do_div in one function. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-04-15[media] Prefer gspca_sonixb over sn9c102 for all devicesJean Delvare
The sn9c102 driver is deprecated. It was moved to staging in anticipation of its removal in a future kernel version. However, USB devices 0C45:6024 and 0C45:6025 are still handled by sn9c102 when both sn9c102 and gspca_sonixb are enabled. We must migrate all the users of these devices to the gspca_sonixb driver now, so that it gets sufficient testing before the sn9c102 driver is finally phased out. Signed-off-by: Jean Delvare <jdelvare@suse.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-09-26[media] gspca: print small buffers via %*phAndy Shevchenko
Instead of passing each byte through stack let's use %*ph specifier to do this job better. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-09-26[media] gspca: store current mode instead of individual parametersOndrej Zary
Store complete current mode (struct v4l2_pix_format) in struct gspca_dev instead of separate pixfmt, width and height parameters. This is a preparation for variable resolution support. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-05-07[media] gspca-sonixb: Adjust hstart on sn9c103 + pas202Hans de Goede
For some unknown reason we need to increase hstart by 1 on when using the PAS202 on the sn9c103 (versus on the sn9c102), otherwise we get the wrong colors, due to shifting of the bayer pattern. Reported-by: Patrizio Bassi <patrizio.bassi@gmail.com> Tested-by: Patrizio Bassi <patrizio.bassi@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-05[media] gspca_sonixb: Remove querymenu function (dead code)Hans Verkuil
We forgot to remove that when sonixb was converted to the control framework. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-02-05[media] usb/gspca/sonixb.c: use IS_ENABLED() macroPeter Senna Tschudin
replace: #if defined(CONFIG_INPUT) || \ defined(CONFIG_INPUT_MODULE) with: #if IS_ENABLED(CONFIG_INPUT) This change was made for: CONFIG_INPUT Also replaced: #if !defined CONFIG_USB_SN9C102 && !defined CONFIG_USB_SN9C102_MODULE with: #if !IS_ENABLED(CONFIG_USB_SN9C102) Reported-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-12-21[media] gspca_sonixb: Properly wait between i2c writesHans de Goede
We must wait for the previous i2c write to complete before starting a new one. Sofar we were getting away with this, but it seems that some parts of the usb-subsystem has been sped up making us go to fast :) This fixes streaming on sn9c103 based cams not working with an "i2c_w error" error. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-11-21[media] gspca-sonixb: Add USB-id for Genius Eye 310Hans de Goede
Reported through: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1046608 https://bugzilla.kernel.org/show_bug.cgi?id=48111 Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15[media] rename most media/video usb drivers to media/usbMauro Carvalho Chehab
Rename all USB drivers with their own directory under drivers/media/video into drivers/media/usb and update the building system. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>