Skip to content

Commit 298455f

Browse files
sudipm-mukherjeegregkh
authored andcommitted
bt8xx: fix memory leak
[ Upstream commit 6792eb0cf9310ec240b7e7c9bfa86dff4c758c68 ] If dvb_attach() fails then we were just printing an error message and exiting but the memory allocated to state was not released. Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4b7a358 commit 298455f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/media/pci/bt8xx/dvb-bt8xx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
680680
/* DST is not a frontend, attaching the ASIC */
681681
if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) {
682682
pr_err("%s: Could not find a Twinhan DST\n", __func__);
683+
kfree(state);
683684
break;
684685
}
685686
/* Attach other DST peripherals if any */

0 commit comments

Comments
 (0)