summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2017-12-21 13:13:59 +0100
committerDavid S. Miller <davem@davemloft.net>2017-12-26 13:02:05 -0500
commit4853f128c13ed2731625dff2410b7fdbe540fb26 (patch)
treeb58ac455944c25998e868de3e600fa2ca6906417
parent0a3d805c9c503e05d6e5d3868c53e92a06589dcf (diff)
net: sched: fix possible null pointer deref in tcf_block_put
We need to check block for being null in both tcf_block_put and tcf_block_put_ext. Fixes: 343723dd51ef ("net: sched: fix clsact init error path") Reported-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/cls_api.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index b91ea03e3afa..b9d63d2246e6 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -379,6 +379,8 @@ void tcf_block_put(struct tcf_block *block)
{
struct tcf_block_ext_info ei = {0, };
+ if (!block)
+ return;
tcf_block_put_ext(block, block->q, &ei);
}