All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init()
Date: Fri, 27 Jan 2017 08:06:22 +0000	[thread overview]
Message-ID: <20170127080622.GA4153@mwanda> (raw)

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>

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)

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init()
Date: Fri, 27 Jan 2017 11:06:22 +0300	[thread overview]
Message-ID: <20170127080622.GA4153@mwanda> (raw)

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>

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)

             reply	other threads:[~2017-01-27  8:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-27  8:06 Dan Carpenter [this message]
2017-01-27  8:06 ` [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() Dan Carpenter
2017-01-27  8:15 ` [patch] [media] add device IDs to ngene vdr
2017-01-27 13:20   ` [PATCH] [MEDIA] " vdr
2017-02-07  8:42     ` [PATCH] [MEDIA] add device ID to ati remote vdr
2017-02-13 13:42       ` Sean Young
2017-02-13 22:57         ` Helmut Auer
2017-02-14  7:11         ` Helmut Auer
2017-02-14  7:20     ` [PATCH] [MEDIA] add device IDs to ngene driver Helmut Auer
2017-01-27  8:29 ` [patch] [media] mantis_dvb: fix some error codes in mantis_dvb_init() walter harms
2017-01-27  8:29   ` walter harms
2017-01-27  9:46   ` Dan Carpenter
2017-01-27  9:46     ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170127080622.GA4153@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.