From: Pieter Jansen van Vuuren Date: Wed, 8 May 2019 22:56:07 +0000 (-0700) Subject: net/sched: avoid double free on matchall reoffload X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5f05836831f6142081e216f27e1ae8f4b26d3585;p=linux.git net/sched: avoid double free on matchall reoffload Avoid freeing cls_mall.rule twice when failing to setup flow_action offload used in the hardware intermediate representation. This is achieved by returning 0 when the setup fails but the skip software flag has not been set. Fixes: f00cbf196814 ("net/sched: use the hardware intermediate representation for matchall") Reported-by: Dan Carpenter Signed-off-by: Pieter Jansen van Vuuren Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller --- diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index 1e98a517fb0b4..db42d97a20064 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c @@ -308,6 +308,7 @@ static int mall_reoffload(struct tcf_proto *tp, bool add, tc_setup_cb_t *cb, NL_SET_ERR_MSG_MOD(extack, "Failed to setup flow action"); return err; } + return 0; } err = cb(TC_SETUP_CLSMATCHALL, &cls_mall, cb_priv);