diff options
| author | Gustavo A. R. Silva <gustavoars@kernel.org> | 2022-01-20 16:29:33 -0600 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-26 14:02:15 +0100 |
| commit | 4213e92ef7ec24b52e34f8a869e4213abca3dc6e (patch) | |
| tree | e65c12a068ed369f0e202ec76e92521b70b380f3 /drivers/usb/core/hcd-pci.c | |
| parent | 7643fd78e1467642757224bd9c39b4bce4422e50 (diff) | |
| download | linux-4213e92ef7ec24b52e34f8a869e4213abca3dc6e.tar.gz linux-4213e92ef7ec24b52e34f8a869e4213abca3dc6e.tar.bz2 linux-4213e92ef7ec24b52e34f8a869e4213abca3dc6e.zip | |
usb: gadget: f_fs: Use struct_size() and flex_array_size() helpers
Make use of the struct_size() and flex_array_size() helpers instead of
an open-coded version, in order to avoid any potential type mistakes
or integer overflows that, in the worst scenario, could lead to heap
overflows.
Also, address the following sparse warnings:
drivers/usb/gadget/function/f_fs.c:922:23: warning: using sizeof on a flexible structure
Link: https://github.com/KSPP/linux/issues/174
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20220120222933.GA35155@embeddedor
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/hcd-pci.c')
0 files changed, 0 insertions, 0 deletions
