diff options
| author | Dan Carpenter <[email protected]> | 2019-02-18 09:26:32 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2019-02-21 21:11:07 +0000 |
| commit | af736bf071e8ccf395fa7f7d9d105e020cf609cc (patch) | |
| tree | 29c55cdda7ff511bcb74baa0f1b11ad19e71c759 /net/sched/cls_api.c | |
| parent | lib/test_rhashtable: fix spelling mistake "existant" -> "existent" (diff) | |
| download | kernel-af736bf071e8ccf395fa7f7d9d105e020cf609cc.tar.gz kernel-af736bf071e8ccf395fa7f7d9d105e020cf609cc.zip | |
net: sched: potential NULL dereference in tcf_block_find()
The error code isn't set on this path so it would result in returning
ERR_PTR(0) and a NULL dereference in the caller.
Fixes: 18d3eefb17cf ("net: sched: refactor tcf_block_find() into standalone functions")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/sched/cls_api.c')
| -rw-r--r-- | net/sched/cls_api.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index 9ad53895e604..28592e9f803f 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c @@ -1309,8 +1309,10 @@ static struct tcf_block *tcf_block_find(struct net *net, struct Qdisc **q, goto errout_qdisc; block = __tcf_block_find(net, *q, *cl, ifindex, block_index, extack); - if (IS_ERR(block)) + if (IS_ERR(block)) { + err = PTR_ERR(block); goto errout_qdisc; + } return block; |
