mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
net: sched: Fix qdisc_rate_table refcount leak when get tcf_block failed
[ Upstream commitc660701258
] The reference counting issue happens in one exception handling path of cbq_change_class(). When failing to get tcf_block, the function forgets to decrease the refcount of "rtab" increased by qdisc_put_rtab(), causing a refcount leak. Fix this issue by jumping to "failure" label when get tcf_block failed. Fixes:6529eaba33
("net: sched: introduce tcf block infractructure") Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Reviewed-by: Cong Wang <cong.wang@bytedance.com> Link: https://lore.kernel.org/r/1630252681-71588-1-git-send-email-xiyuyang19@fudan.edu.cn Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f484595be6
commit
76e26651c8
1 changed files with 1 additions and 1 deletions
|
@ -1590,7 +1590,7 @@ cbq_change_class(struct Qdisc *sch, u32 classid, u32 parentid, struct nlattr **t
|
|||
err = tcf_block_get(&cl->block, &cl->filter_list);
|
||||
if (err) {
|
||||
kfree(cl);
|
||||
return err;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
if (tca[TCA_RATE]) {
|
||||
|
|
Loading…
Reference in a new issue