]> git.baikalelectronics.ru Git - kernel.git/commit
net_sched: check NULL in tcf_block_put()
authorCong Wang <xiyou.wangcong@gmail.com>
Fri, 3 Nov 2017 00:32:08 +0000 (17:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Nov 2017 12:31:15 +0000 (21:31 +0900)
commite0aa1ebfb57afd30bc854f3818e2a2cd5a69c3e9
tree63b2a6ab926d369762e0b7e0bbfaa205a81f4471
parenta860f151c1ce94762f3b8bf68a79b3dde5d762d8
net_sched: check NULL in tcf_block_put()

Callers of tcf_block_put() could pass NULL so
we can't use block->q before checking if block is
NULL or not.

tcf_block_put_ext() callers are fine, it is always
non-NULL.

Fixes: 9602042b40e8 ("net: sched: add block bind/unbind notif. and extended block_get/put")
Reported-by: Dave Taht <dave.taht@gmail.com>
Cc: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/cls_api.c