android_kernel_oneplus_msm8998/drivers/media/pci/ttpci
Arnd Bergmann 2536c20e82 ttpci: address stringop overflow warning
commit 69d3973af1acd4c0989ec8218c05f12d303cd7cf 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
..
av7110.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
av7110.h [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
av7110_av.c [media] dvb: get rid of enum dmx_success 2015-10-06 19:53:02 -03:00
av7110_av.h
av7110_ca.c
av7110_ca.h
av7110_hw.c ttpci: address stringop overflow warning 2017-10-08 10:14:20 +02:00
av7110_hw.h ttpci: address stringop overflow warning 2017-10-08 10:14:20 +02:00
av7110_ipack.c
av7110_ipack.h
av7110_ir.c
av7110_v4l.c
budget-av.c [media] ttpci: Replace memset with eth_zero_addr 2015-08-11 12:50:56 -03:00
budget-ci.c
budget-core.c [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
budget-patch.c [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
budget.c [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
budget.h [media] dvb: Get rid of typedev usage for enums 2015-06-09 17:47:35 -03:00
Kconfig
Makefile
ttpci-eeprom.c [media] ttpci: Replace memset with eth_zero_addr 2015-08-11 12:50:56 -03:00
ttpci-eeprom.h