linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug report: null dereference in error handling in mantis_dvb_init()
@ 2012-05-17  7:10 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2012-05-17  7:10 UTC (permalink / raw)
  To: linux-media; +Cc: abraham.manu

Hi,

I'm working on some new Smatch stuff and so I'm finding old bugs and
emailing bug reports.

----
This is a semi-automatic email about new static checker warnings.

The patch 68fe255cd15c: "V4L/DVB (13799): [Mantis] Unregister 
frontend" from Dec 4, 2009, leads to the following Smatch complaint:

drivers/media/dvb/mantis/mantis_dvb.c:251 mantis_dvb_init()
	 error: we previously assumed 'mantis->fe' could be null (see line 228)

drivers/media/dvb/mantis/mantis_dvb.c
   227			} else {
   228				if (mantis->fe == NULL) {
   229					dprintk(MANTIS_ERROR, 1, "FE <NULL>");
   230					goto err5;

"mantis->fe" is NULL on this path.

   231				}
   232	
   233				if (dvb_register_frontend(&mantis->dvb_adapter, mantis->fe)) {
   234					dprintk(MANTIS_ERROR, 1, "ERROR: Frontend registration failed");
   235	
   236					if (mantis->fe->ops.release)
   237						mantis->fe->ops.release(mantis->fe);
   238	
   239					mantis->fe = NULL;

And here.

   240					goto err5;
   241				}
   242			}
   243		}
   244	
   245		return 0;
   246	
   247		/* Error conditions ..	*/
   248	err5:
   249		tasklet_kill(&mantis->tasklet);
   250		dvb_net_release(&mantis->dvbnet);
   251		dvb_unregister_frontend(mantis->fe);
                ^^^^^^^^^^^^^^^^^^^^^^^
This new call to dvb_unregister_frontend() was added but it can't handle
NULL pointers.

   252		dvb_frontend_detach(mantis->fe);
   253	err4:

regards,
dan carpenter


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

only message in thread, other threads:[~2012-05-17  7:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-17  7:10 bug report: null dereference in error handling in mantis_dvb_init() 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).