Skip to content

Commit 4853f12

Browse files
jpirkodavem330
authored andcommitted
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: 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]>
1 parent 0a3d805 commit 4853f12

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/sched/cls_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ void tcf_block_put(struct tcf_block *block)
379379
{
380380
struct tcf_block_ext_info ei = {0, };
381381

382+
if (!block)
383+
return;
382384
tcf_block_put_ext(block, block->q, &ei);
383385
}
384386

0 commit comments

Comments
 (0)