kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] [media] ddbridge: remove unneeded an NULL check
@ 2014-03-01 13:55 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-03-01 13:55 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Jingoo Han, linux-media, kernel-janitors

Static checkers complain about the inconsistent NULL check here.

There is an unchecked dereference of "intput->fe" in the call to
tuner_attach_tda18271() and there is a second unchecked dereference a
couple lines later when we do:
	input->fe2->tuner_priv = input->fe->tuner_priv;

But actually "intput->fe" can't be NULL because if demod_attach_drxk()
fails to allocate it, then we would have return an error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/media/pci/ddbridge/ddbridge-core.c b/drivers/media/pci/ddbridge/ddbridge-core.c
index 9375f30d9a81..fb52bda8d45f 100644
--- a/drivers/media/pci/ddbridge/ddbridge-core.c
+++ b/drivers/media/pci/ddbridge/ddbridge-core.c
@@ -876,10 +876,8 @@ static int dvb_input_attach(struct ddb_input *input)
 			return -ENODEV;
 		if (tuner_attach_tda18271(input) < 0)
 			return -ENODEV;
-		if (input->fe) {
-			if (dvb_register_frontend(adap, input->fe) < 0)
-				return -ENODEV;
-		}
+		if (dvb_register_frontend(adap, input->fe) < 0)
+			return -ENODEV;
 		if (input->fe2) {
 			if (dvb_register_frontend(adap, input->fe2) < 0)
 				return -ENODEV;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-03-01 13:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-01 13:55 [patch] [media] ddbridge: remove unneeded an NULL check Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).