diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 4c5fe4504dfc..ce732ce9f9c9 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c @@ -427,6 +427,9 @@ static int route4_set_parms(struct net *net, struct tcf_proto *tp, goto errout; } + if (!nhandle) + return -EINVAL; + h1 = to_hash(nhandle); b = rtnl_dereference(head->table[h1]); if (!b) { @@ -486,6 +489,9 @@ static int route4_change(struct net *net, struct sk_buff *in_skb, int err; bool new = true; + if (!handle) + return -EINVAL; + if (opt == NULL) return handle ? -EINVAL : 0;