diff options
author | David S. Miller <davem@davemloft.net> | 2018-02-20 02:46:11 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-20 02:46:11 +0300 |
commit | f5c0c6f4299f870f074235fbf552ecf957fc249c (patch) | |
tree | 6b46b9c0b271185b6f98fab350c3891042e729b1 /include/linux/ptr_ring.h | |
parent | 26736a08ee0fb89a4f09bfb2c9f0805028ff63aa (diff) | |
parent | 79c0ef3e85c015b0921a8fd5dd539d1480e9cd6c (diff) | |
download | linux-f5c0c6f4299f870f074235fbf552ecf957fc249c.tar.xz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'include/linux/ptr_ring.h')
-rw-r--r-- | include/linux/ptr_ring.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/ptr_ring.h b/include/linux/ptr_ring.h index ddfed1dce936..6894976b54e3 100644 --- a/include/linux/ptr_ring.h +++ b/include/linux/ptr_ring.h @@ -470,7 +470,7 @@ static inline int ptr_ring_consume_batched_bh(struct ptr_ring *r, */ static inline void **__ptr_ring_init_queue_alloc(unsigned int size, gfp_t gfp) { - if (size * sizeof(void *) > KMALLOC_MAX_SIZE) + if (size > KMALLOC_MAX_SIZE / sizeof(void *)) return NULL; return kvmalloc_array(size, sizeof(void *), gfp | __GFP_ZERO); } |