Re: [PATCH] atm: idt77252: fix a memleak in open_card_ubr0

From: Jiri Pirko
Date: Thu Feb 01 2024 - 08:29:49 EST


Thu, Feb 01, 2024 at 01:41:05PM CET, alexious@xxxxxxxxxx wrote:
>When alloc_scq fails, card->vcs[0] (i.e. vc) should be freed. Otherwise,
>in the following call chain:
>
>idt77252_init_one
> |-> idt77252_dev_open
> |-> open_card_ubr0
> |-> alloc_scq [failed]
> |-> deinit_card
> |-> vfree(card->vcs);
>
>card->vcs is freed and card->vcs[0] is leaked.
>
>Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
>Signed-off-by: Zhipeng Lu <alexious@xxxxxxxxxx>

Reviewed-by: Jiri Pirko <jiri@xxxxxxxxxx>