]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
firestream: Fix memleak in fs_open
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sun, 23 Aug 2020 11:29:35 +0000 (19:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Sep 2020 06:44:23 +0000 (08:44 +0200)
[ Upstream commit 15ac5cdafb9202424206dc5bd376437a358963f9 ]

When make_rate() fails, vcc should be freed just
like other error paths in fs_open().

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/atm/firestream.c

index 04b39d0da868129ac3dab58ce711fb64ae8f7912..70708608ab1e7b7866fd914ba904acd13d1ea95b 100644 (file)
@@ -1009,6 +1009,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
                                error = make_rate (pcr, r, &tmc0, NULL);
                                if (error) {
                                        kfree(tc);
+                                       kfree(vcc);
                                        return error;
                                }
                        }