* [patch net] net: sched: fix possible null pointer deref in tcf_block_put
@ 2017-12-21 12:13 Jiri Pirko
2017-12-26 18:02 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Pirko @ 2017-12-21 12:13 UTC (permalink / raw)
To: netdev; +Cc: davem, jhs, xiyou.wangcong, mlxsw, bhole_prashant_q7
From: Jiri Pirko <jiri@mellanox.com>
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>
---
net/sched/cls_api.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index b91ea03..b9d63d2 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);
}
--
2.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-26 18:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21 12:13 [patch net] net: sched: fix possible null pointer deref in tcf_block_put Jiri Pirko
2017-12-26 18:02 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox