[media] mantis_dvb: fix some error codes in mantis_dvb_init()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 27 Jan 2017 08:06:22 +0000 (06:06 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 3 Feb 2017 16:50:35 +0000 (14:50 -0200)
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>
drivers/media/pci/mantis/mantis_dvb.c

index 5a71e1791cf5a00ab1d198520c380cf7a44c1890..0db4de3a228522089de86ec2a5ce7314fde64b37 100644 (file)
@@ -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)