net: sched: fix p_filter_chain check in tcf_chain_flush
Subsystems (3)
Jiri Pirko
maintainerPATCH 1/1 net: sched: fix p_filter_chain check in tcf_chain_flush
From: Jiri Pirko <[email protected]>
The dereference before check is wrong and leads to an oops when p_filter_chain is NULL. The check needs to be done on the pointer to prevent NULL dereference.
Fixes f93e1cdcf42c ("net/sched: fix filter flushing")
Signed-off-by Jiri Pirko <[email protected]>
--- net/sched/cls_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/cls_api.c +1 -1
@@ -190,7 +190,7 @@ static void tcf_chain_flush(struct tcf_chain *chain) {struct tcf_proto *tp; -if (*chain->p_filter_chain) +if (chain->p_filter_chain)RCU_INIT_POINTER (*chain->p_filter_chain,NULL );while ((tp =rtnl_dereference (chain->filter_chain)) !=NULL ) {RCU_INIT_POINTER (chain->filter_chain, tp->next);
Signature · 1 line
2.9.3
Quoted 8 lines · Jiri Pirko
From: Jiri Pirko <[email protected]>
The dereference before check is wrong and leads to an oops when
p_filter_chainis NULL. The check needs to be done on the pointer to prevent NULL dereference.Fixes f93e1cdcf42c ("net/sched: fix filter flushing")Signed-off-by Jiri Pirko <[email protected]>
Acked-by Cong Wang <[email protected]>
From: Jiri Pirko <[email protected]>
Date: Fri, 18 Aug 2017 10:10:43 +0200
Quoted 8 lines
From: Jiri Pirko <[email protected]>
The dereference before check is wrong and leads to an oops when
p_filter_chainis NULL. The check needs to be done on the pointer to prevent NULL dereference.Fixes f93e1cdcf42c ("net/sched: fix filter flushing")Signed-off-by Jiri Pirko <[email protected]>
Applied, thanks Jiri.