The setup callback will be unconditionally passed to the
alloc_netdev_mqs(), where the NULL pointer dereference will cause the
kernel panic. So refuse to register WWAN netdev ops with warning
generation if the setup callback is not provided.
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Reviewed-by: Loic Poulain <loic.poulain@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
{
struct wwan_device *wwandev;
- if (WARN_ON(!parent || !ops))
+ if (WARN_ON(!parent || !ops || !ops->setup))
return -EINVAL;
wwandev = wwan_create_dev(parent);