summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-01-27 06:06:22 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-02-03 14:50:35 -0200
commit79a2eda80c6dab79790c308d9f50ecd2e5021ba3 (patch)
treed1e663e1a4bee25e232767fe9cc67b235926c85b /drivers/media
parentc2987aaf0c9c2bcb0d4c5902d61473d9aa018a3d (diff)
downloadlinux-79a2eda80c6dab79790c308d9f50ecd2e5021ba3.tar.bz2
[media] mantis_dvb: fix some error codes in mantis_dvb_init()
We should be returning negative error codes here or it leads to a crash. This also silences a static checker warning. drivers/media/pci/mantis/mantis_cards.c:250 mantis_pci_probe() warn: 'mantis->dmxdev.dvbdev->fops' double freed Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/pci/mantis/mantis_dvb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/pci/mantis/mantis_dvb.c b/drivers/media/pci/mantis/mantis_dvb.c
index 5a71e1791cf5..0db4de3a2285 100644
--- a/drivers/media/pci/mantis/mantis_dvb.c
+++ b/drivers/media/pci/mantis/mantis_dvb.c
@@ -226,11 +226,12 @@ int mantis_dvb_init(struct mantis_pci *mantis)
goto err5;
} else {
if (mantis->fe == NULL) {
+ result = -ENOMEM;
dprintk(MANTIS_ERROR, 1, "FE <NULL>");
goto err5;
}
-
- if (dvb_register_frontend(&mantis->dvb_adapter, mantis->fe)) {
+ result = dvb_register_frontend(&mantis->dvb_adapter, mantis->fe);
+ if (result) {
dprintk(MANTIS_ERROR, 1, "ERROR: Frontend registration failed");
if (mantis->fe->ops.release)