Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d68d75fd authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

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: 33a48927 ("sched: push TC filter protocol creation into a separate function")
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Acked-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f4d641a2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;