gtp: avoid zero size hashtable
authorTaehee Yoo <ap420073@gmail.com>
Wed, 11 Dec 2019 08:23:48 +0000 (08:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 18:19:10 +0000 (19:19 +0100)
commit85ee5098dd03873ff98e9f4b3cd55c9a302a4c21
treefc920daf3d515bdcb788abeb6e9068be0d9bf1df
parentb040f61ef66970f2c1f7c174d3c5a111e7c969e5
gtp: avoid zero size hashtable

[ Upstream commit 6a902c0f31993ab02e1b6ea7085002b9c9083b6a ]

GTP default hashtable size is 1024 and userspace could set specific
hashtable size with IFLA_GTP_PDP_HASHSIZE. If hashtable size is set to 0
from userspace,  hashtable will not work and panic will occur.

Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/gtp.c