linux/drivers/media
Arnd Bergmann 2536c20e82 ttpci: address stringop overflow warning
commit 69d3973af1 upstream.

gcc-7.0.1 warns about old code in ttpci:

In file included from drivers/media/pci/ttpci/av7110.c:63:0:
In function 'irdebi.isra.2',
    inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
    inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:659:3:
drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   memcpy(av7110->debi_virt, (char *) &res, count);
In function 'irdebi.isra.2',
    inlined from 'start_debi_dma' at drivers/media/pci/ttpci/av7110.c:376:3,
    inlined from 'gpioirq' at drivers/media/pci/ttpci/av7110.c:668:3:
drivers/media/pci/ttpci/av7110_hw.h:406:3: warning: 'memcpy': specified size between 18446744071562067968 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
   memcpy(av7110->debi_virt, (char *) &res, count);

Apparently, 'count' can be negative here, which will then get turned
into a giant size argument for memcpy. Changing the sizes to 'unsigned
int' instead seems safe as we already check for maximum sizes, and it
also simplifies the code a bit.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-08 10:14:20 +02:00
..
common [media] saa7146: use swap() in sort_and_eliminate() 2015-07-06 08:25:49 -03:00
dvb-core media: dvb_ringbuffer: Add memory barriers 2016-08-20 18:09:18 +02:00
dvb-frontends dvb-frontends/cxd2841er: define symbol_rate_min/max in T/C fe-ops 2017-05-25 14:30:14 +02:00
firewire [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
i2c v4l: s5c73m3: fix negation operator 2017-08-06 19:19:42 -07:00
mmc [media] siano: register media controller earlier 2015-02-26 09:10:39 -03:00
pci ttpci: address stringop overflow warning 2017-10-08 10:14:20 +02:00
platform exynos-gsc: Do not swap cb/cr for semi planar formats 2017-10-08 10:14:19 +02:00
radio [media] radio: Drop owner assignment from i2c_driver 2015-08-11 13:01:08 -03:00
rc media: lirc: LIRC_GET_REC_RESOLUTION should return microseconds 2017-08-11 09:08:50 -07:00
tuners xc2028: Fix use-after-free bug properly 2017-05-25 14:30:15 +02:00
usb media: uvcvideo: Prevent heap overflow when accessing mapped controls 2017-09-27 11:00:16 +02:00
v4l2-core media: v4l2-compat-ioctl32: Fix timespec conversion 2017-09-27 11:00:16 +02:00
Kconfig media updates for v4.2-rc1 2015-06-25 17:55:48 -07:00
Makefile [media] bq/c-qcam, w9966, pms: move to staging in preparation for removal 2014-12-16 23:21:44 -02:00
media-device.c [media] media: Use strlcpy instead of custom code 2014-09-21 20:27:08 -03:00
media-devnode.c
media-entity.c [media] media-entity.c: get rid of var length arrays 2015-10-01 18:10:05 -03:00