diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-12 21:28:00 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-12 21:28:00 -0400 |
| commit | b08fc5277aaa1d8ea15470d38bf36f19dfb0e125 (patch) | |
| tree | 1910dc474cb1ede95581dd9faa81a3bebeded0dc /drivers/net/ethernet/cavium/liquidio/request_manager.c | |
| parent | 4597fcff07044d89c646d0c5d8b42cd976d966a1 (diff) | |
| parent | 9d2a789c1db75d0f55b14fa57bec548d94332ad8 (diff) | |
Merge tag 'overflow-v4.18-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull more overflow updates from Kees Cook:
"The rest of the overflow changes for v4.18-rc1.
This includes the explicit overflow fixes from Silvio, further
struct_size() conversions from Matthew, and a bug fix from Dan.
But the bulk of it is the treewide conversions to use either the
2-factor argument allocators (e.g. kmalloc(a * b, ...) into
kmalloc_array(a, b, ...) or the array_size() macros (e.g. vmalloc(a *
b) into vmalloc(array_size(a, b)).
Coccinelle was fighting me on several fronts, so I've done a bunch of
manual whitespace updates in the patches as well.
Summary:
- Error path bug fix for overflow tests (Dan)
- Additional struct_size() conversions (Matthew, Kees)
- Explicitly reported overflow fixes (Silvio, Kees)
- Add missing kvcalloc() function (Kees)
- Treewide conversions of allocators to use either 2-factor argument
variant when available, or array_size() and array3_size() as needed
(Kees)"
* tag 'overflow-v4.18-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: (26 commits)
treewide: Use array_size in f2fs_kvzalloc()
treewide: Use array_size() in f2fs_kzalloc()
treewide: Use array_size() in f2fs_kmalloc()
treewide: Use array_size() in sock_kmalloc()
treewide: Use array_size() in kvzalloc_node()
treewide: Use array_size() in vzalloc_node()
treewide: Use array_size() in vzalloc()
treewide: Use array_size() in vmalloc()
treewide: devm_kzalloc() -> devm_kcalloc()
treewide: devm_kmalloc() -> devm_kmalloc_array()
treewide: kvzalloc() -> kvcalloc()
treewide: kvmalloc() -> kvmalloc_array()
treewide: kzalloc_node() -> kcalloc_node()
treewide: kzalloc() -> kcalloc()
treewide: kmalloc() -> kmalloc_array()
mm: Introduce kvcalloc()
video: uvesafb: Fix integer overflow in allocation
UBIFS: Fix potential integer overflow in allocation
leds: Use struct_size() in allocation
Convert intel uncore to struct_size
...
Diffstat (limited to 'drivers/net/ethernet/cavium/liquidio/request_manager.c')
| -rw-r--r-- | drivers/net/ethernet/cavium/liquidio/request_manager.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/request_manager.c b/drivers/net/ethernet/cavium/liquidio/request_manager.c index b1270355b0b1..1f2e75da28f8 100644 --- a/drivers/net/ethernet/cavium/liquidio/request_manager.c +++ b/drivers/net/ethernet/cavium/liquidio/request_manager.c | |||
| @@ -98,8 +98,9 @@ int octeon_init_instr_queue(struct octeon_device *oct, | |||
| 98 | iq->request_list = vmalloc_node((sizeof(*iq->request_list) * num_descs), | 98 | iq->request_list = vmalloc_node((sizeof(*iq->request_list) * num_descs), |
| 99 | numa_node); | 99 | numa_node); |
| 100 | if (!iq->request_list) | 100 | if (!iq->request_list) |
| 101 | iq->request_list = vmalloc(sizeof(*iq->request_list) * | 101 | iq->request_list = |
| 102 | num_descs); | 102 | vmalloc(array_size(num_descs, |
| 103 | sizeof(*iq->request_list))); | ||
| 103 | if (!iq->request_list) { | 104 | if (!iq->request_list) { |
| 104 | lio_dma_free(oct, q_size, iq->base_addr, iq->base_addr_dma); | 105 | lio_dma_free(oct, q_size, iq->base_addr, iq->base_addr_dma); |
| 105 | dev_err(&oct->pci_dev->dev, "Alloc failed for IQ[%d] nr free list\n", | 106 | dev_err(&oct->pci_dev->dev, "Alloc failed for IQ[%d] nr free list\n", |
