Skip to content

Commit 21641c2

Browse files
congwangdavem330
authored andcommitted
net_sched: check NULL on error path in route4_change()
On error path in route4_change(), 'f' could be NULL, so we should check NULL before calling tcf_exts_destroy(). Fixes: b9a24bb ("net_sched: properly handle failure case of tcf_exts_init()") Reported-by: kbuild test robot <[email protected]> Cc: Jamal Hadi Salim <[email protected]> Signed-off-by: Cong Wang <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d6989d4 commit 21641c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/sched/cls_route.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,
559559
return 0;
560560

561561
errout:
562-
tcf_exts_destroy(&f->exts);
562+
if (f)
563+
tcf_exts_destroy(&f->exts);
563564
kfree(f);
564565
return err;
565566
}

0 commit comments

Comments
 (0)