]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: sched: fix possible null pointer deref in tcf_block_put
authorJiri Pirko <jiri@mellanox.com>
Thu, 21 Dec 2017 12:13:59 +0000 (13:13 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 26 Dec 2017 18:02:05 +0000 (13:02 -0500)
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>
net/sched/cls_api.c

index b91ea03e3afa717225c00a3d2a03e9d722229fbc..b9d63d2246e667329c30606165dd485b9dc777aa 100644 (file)
@@ -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);
 }