Skip to content

Commit d68d75f

Browse files
jpirkodavem330
authored andcommitted
net: sched: fix error path in tcf_proto_create() when modules are not configured
In case modules are not configured, error out when tp->ops is null and prevent later null pointer dereference. Fixes: 33a4892 ("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]>
1 parent f4d641a commit d68d75f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/cls_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ static struct tcf_proto *tcf_proto_create(const char *kind, u32 protocol,
152152
NL_SET_ERR_MSG(extack, "TC classifier not found");
153153
err = -ENOENT;
154154
}
155-
goto errout;
156155
#endif
156+
goto errout;
157157
}
158158
tp->classify = tp->ops->classify;
159159
tp->protocol = protocol;

0 commit comments

Comments
 (0)