linux/include
Martin Kelly 9e70dd43a0 iio:buffer: make length types match kfifo types
commit c043ec1ca5 upstream.

Currently, we use int for buffer length and bytes_per_datum. However,
kfifo uses unsigned int for length and size_t for element size. We need
to make sure these matches or we will have bugs related to overflow (in
the range between INT_MAX and UINT_MAX for length, for example).

In addition, set_bytes_per_datum uses size_t while bytes_per_datum is an
int, which would cause bugs for large values of bytes_per_datum.

Change buffer length to use unsigned int and bytes_per_datum to use
size_t.

Signed-off-by: Martin Kelly <mkelly@xevo.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
[bwh: Backported to 3.16:
 - Drop change in iio_dma_buffer_set_length()
 - Adjust filenames, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2018-10-21 08:45:05 +01:00
..
acpi ACPICA: Tables: Enable default 64-bit FADT addresses favor 2015-07-15 10:01:11 +01:00
asm-generic x86/speculation/l1tf: Unbreak !__HAVE_ARCH_PFN_MODIFY_ALLOWED architectures 2018-10-03 04:10:05 +01:00
clocksource drivers: clocksource: add support for ARM architected timer event stream 2013-09-26 09:48:00 +01:00
crypto crypto: hash - prevent using keyed hashes without setting key 2018-06-16 22:21:52 +01:00
drm drm: Allow determining if current task is output poll worker 2018-06-16 22:22:18 +01:00
dt-bindings pinctrl: dra: dt-bindings: Fix output pull up/down 2014-11-27 11:22:05 +00:00
keys KEYS: Separate the kernel signature checking keyring from module signing 2013-09-25 17:17:01 +01:00
kvm arm/arm64: KVM: Require in-kernel vgic for the arch timers 2015-05-20 13:25:52 +01:00
linux iio:buffer: make length types match kfifo types 2018-10-21 08:45:05 +01:00
math-emu math-emu: fix floating-point to integer overflow detection 2014-01-07 18:36:24 -06:00
media media: vb2: fix VBI/poll regression 2014-10-09 12:23:49 -07:00
memory ddr: add LPDDR2 data from JESD209-2 2012-05-02 00:04:06 -07:00
misc [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
net net: core: dst: Add kernel-doc for 'net' parameter 2018-10-21 08:44:52 +01:00
pcmcia pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate 2013-03-15 12:26:03 -07:00
ras edac: add support for error type "Info" 2013-02-21 14:16:27 -03:00
rdma IB/cma: Fix reference count leak when no ipv4 addresses are set 2017-11-11 13:33:05 +00:00
rxrpc atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
scsi scsi: libsas: remove the numbering for each event enum 2018-06-16 22:21:30 +01:00
sound ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams 2018-10-21 08:44:59 +01:00
target target/iscsi: Fix iSCSI task reassignment handling 2018-02-13 18:42:18 +00:00
trace KVM: Fix stack-out-of-bounds read in write_mmio 2018-01-01 20:52:11 +00:00
uapi seccomp: Add filter flag to opt-out of SSB mitigation 2018-10-03 04:09:43 +01:00
video Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2014-06-12 11:32:30 -07:00
xen xen: Add xen_arch_suspend() 2018-06-16 22:22:30 +01:00
Kbuild UAPI: remove empty Kbuild files 2013-04-30 17:04:09 -07:00