Skip to content

Commit

Permalink
net: sched: fix possible null pointer deref in tcf_block_put
Browse files Browse the repository at this point in the history
We need to check block for being null in both tcf_block_put and
tcf_block_put_ext.

Fixes: 343723d ("net: sched: fix clsact init error path")
Reported-by: Prashant Bhole <[email protected]>
Signed-off-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jpirko authored and davem330 committed Dec 26, 2017
1 parent 0a3d805 commit 4853f12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sched/cls_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4853f12

Please sign in to comment.