Re: [PATCH] tcp: use kmalloc() than kmalloc_array().

2015-11-07 Thread Tetsuo Handa
David Miller wrote: > From: Eric Dumazet > Date: Sat, 07 Nov 2015 10:50:07 -0800 > > > I do not feel we should go back to kmalloc() just because > > vmalloc_array() does not exist yet. > > Agreed. > Please change as you like. I was thinking to introduce a helper that does vmalloc() when kmall

Re: [PATCH] tcp: use kmalloc() than kmalloc_array().

2015-11-07 Thread David Miller
From: Eric Dumazet Date: Sat, 07 Nov 2015 10:50:07 -0800 > I do not feel we should go back to kmalloc() just because > vmalloc_array() does not exist yet. Agreed. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More major

Re: [PATCH] tcp: use kmalloc() than kmalloc_array().

2015-11-07 Thread Eric Dumazet
On Sun, 2015-11-08 at 00:50 +0900, Tetsuo Handa wrote: > Commit 095dc8e0c3686d58 ("tcp: fix/cleanup inet_ehash_locks_alloc()") > silently changed from kmalloc() to kmalloc_array(). The latter has > overflow check whereas the former doesn't have. > > If nblocks * locksz might overflow, we need to d

Re: [PATCH] tcp: use kmalloc() than kmalloc_array().

2015-11-07 Thread David Miller
From: Tetsuo Handa Date: Sun, 8 Nov 2015 00:58:50 +0900 > Tetsuo Handa wrote: >> Commit 095dc8e0c3686d58 ("tcp: fix/cleanup inet_ehash_locks_alloc()") >> silently changed from kmalloc() to kmalloc_array(). The latter has >> overflow check whereas the former doesn't have. >> >> If nblocks * locks

Re: [PATCH] tcp: use kmalloc() than kmalloc_array().

2015-11-07 Thread Tetsuo Handa
Tetsuo Handa wrote: > Commit 095dc8e0c3686d58 ("tcp: fix/cleanup inet_ehash_locks_alloc()") > silently changed from kmalloc() to kmalloc_array(). The latter has > overflow check whereas the former doesn't have. > > If nblocks * locksz might overflow, we need to do like > > - if (!hashinfo->eha

[PATCH] tcp: use kmalloc() than kmalloc_array().

2015-11-07 Thread Tetsuo Handa
Commit 095dc8e0c3686d58 ("tcp: fix/cleanup inet_ehash_locks_alloc()") silently changed from kmalloc() to kmalloc_array(). The latter has overflow check whereas the former doesn't have. If nblocks * locksz might overflow, we need to do like - if (!hashinfo->ehash_locks && nblocks > SIZE_MAX / l