OSDN Git Service

net/fq_impl: Switch to kvmalloc() for memory allocation
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 5 Nov 2019 15:57:50 +0000 (16:57 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:19:45 +0000 (09:19 +0100)
commitb707e0da2791c0e8a36c20f81d63fd264a267bf4
treeb3053bd5ffcf4c5e8eb7ffce6dcb3de8aa27a428
parenta8a61f82cc9ff679a5621952f907f129acc23cd6
net/fq_impl: Switch to kvmalloc() for memory allocation

[ Upstream commit 71e67c3bd127cfe7863f54e4b087eba1cc8f9a7a ]

The FQ implementation used by mac80211 allocates memory using kmalloc(),
which can fail; and Johannes reported that this actually happens in
practice.

To avoid this, switch the allocation to kvmalloc() instead; this also
brings fq_impl in line with all the FQ qdiscs.

Fixes: 557fc4a09803 ("fq: add fair queuing framework")
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Link: https://lore.kernel.org/r/20191105155750.547379-1-toke@redhat.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/fq_impl.h