summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorSudip Mukherjee2016-12-16 22:31:49 +0100
committerMauro Carvalho Chehab2017-01-31 10:42:20 +0100
commit6792eb0cf9310ec240b7e7c9bfa86dff4c758c68 (patch)
treea77fce09c6a410aacf922477d113334e57ca9ad2 /drivers/media/pci
parent[media] lirc: fix null dereference for tx-only devices (diff)
downloadkernel-qcow2-linux-6792eb0cf9310ec240b7e7c9bfa86dff4c758c68.tar.gz
kernel-qcow2-linux-6792eb0cf9310ec240b7e7c9bfa86dff4c758c68.tar.xz
kernel-qcow2-linux-6792eb0cf9310ec240b7e7c9bfa86dff4c758c68.zip
[media] bt8xx: fix memory leak
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>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/bt8xx/dvb-bt8xx.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/pci/bt8xx/dvb-bt8xx.c b/drivers/media/pci/bt8xx/dvb-bt8xx.c
index ca047f7a6dc0..ad617871ce9b 100644
--- a/drivers/media/pci/bt8xx/dvb-bt8xx.c
+++ b/drivers/media/pci/bt8xx/dvb-bt8xx.c
@@ -679,6 +679,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
/* DST is not a frontend, attaching the ASIC */
if (dvb_attach(dst_attach, state, &card->dvb_adapter) == NULL) {
pr_err("%s: Could not find a Twinhan DST\n", __func__);
+ kfree(state);
break;
}
/* Attach other DST peripherals if any */