Commit 4853f128 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

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: 343723dd ("net: sched: fix clsact init error path")
Reported-by: default avatarPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a3d805c
...@@ -379,6 +379,8 @@ void tcf_block_put(struct tcf_block *block) ...@@ -379,6 +379,8 @@ void tcf_block_put(struct tcf_block *block)
{ {
struct tcf_block_ext_info ei = {0, }; struct tcf_block_ext_info ei = {0, };
if (!block)
return;
tcf_block_put_ext(block, block->q, &ei); tcf_block_put_ext(block, block->q, &ei);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment