net: sched: fix error path in tcf_proto_create() when modules are not configured
authorJiri Pirko <[email protected]>
Fri, 11 May 2018 15:45:32 +0000 (17:45 +0200)
committerDavid S. Miller <[email protected]>
Fri, 11 May 2018 20:34:38 +0000 (16:34 -0400)
In case modules are not configured, error out when tp->ops is null
and prevent later null pointer dereference.

Fixes: 33a48927c193 ("sched: push TC filter protocol creation into a separate function")
Signed-off-by: Jiri Pirko <[email protected]>
Acked-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/sched/cls_api.c

index b66754f52a9f1cfd18fbddb807a67f015b7c6f0c..963e4bf0aab8ae23d999305208c757fbc0f49ebe 100644 (file)
@@ -152,8 +152,8 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol,
                        NL_SET_ERR_MSG(extack, "TC classifier not found");
                        err = -ENOENT;
                }
-               goto errout;
 #endif
+               goto errout;
        }
        tp->classify = tp->ops->classify;
        tp->protocol = protocol;