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 08:46:26 +0000 (10:46 +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 0e449ee11ac7f7fe71bd75bc6b5e6e80b5609299..e7cffd0cc36165e214a8542fab8ad27f8d3c4b96 100644 (file)
@@ -1013,6 +1013,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;
                                }
                        }