Bluetooth: hci_event: Use struct_size() helper
Gustavo A. R. Silva authored

Make use of the struct_size() helper instead of an open-coded version
in order to avoid any potential type mistakes, in particular in the
context in which this code is being used.

So, change the following form:

sizeof(*ev) + ev->num_hndl * sizeof(struct hci_comp_pkts_info)

 to :

struct_size(ev, handles, ev->num_hndl)

This code was detected with the help of Coccinelle.
Signed-off-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
16e18342
Name Last commit Last update
Documentation Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
LICENSES Merge tag 'docs-4.20' of git://git.lwn.net/linux
arch Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
block block: Cleanup license notice
certs kbuild: remove redundant target cleaning on failure
crypto crypto: sm3 - fix undefined shift by >= width of value
drivers Bluetooth: hci_ldisc: Initialize hci_dev before open()
firmware kbuild: change filechk to surround the given command with { }
fs Merge tag 'pstore-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
include Bluetooth: Allow driver specific cmd timeout handling
init kbuild: Disable LD_DEAD_CODE_DATA_ELIMINATION with ftrace & GCC <= 4.7
ipc ipc: IPCMNI limit check for semmni
kernel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
lib fix int_sqrt64() for very large numbers
mm mm/mmu_notifier: mm/rmap.c: Fix a mmu_notifier range bug in try_to_unmap_one
net Bluetooth: hci_event: Use struct_size() helper
samples samples/bpf: workaround clang asm goto compilation errors
scripts Merge tag 'gcc-plugins-v5.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
security Merge branch 'fixes-v5.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
sound Merge tag 'remove-dma_zalloc_coherent-5.0' of git://git.infradead.org/users/hch/dma-mapping
tools Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
usr user/Makefile: Fix typo and capitalization in comment section
virt KVM: validate userspace input in kvm_clear_dirty_log_protect()
.clang-format clang-format: Update .clang-format with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.