linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug report: potential ERR_PTR dereference in iwm_debugfs_init()
@ 2010-04-22  9:59 Dan Carpenter
  2010-04-23  2:48 ` Zhu Yi
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2010-04-22  9:59 UTC (permalink / raw)
  To: Zhu Yi; +Cc: Intel Linux Wireless, linux-wireless

Hi Zhu Yi,

This is a Smatch bug that has me a little puzzled.

drivers/net/wireless/iwmc3200wifi/debugfs.c +447 iwm_debugfs_init(26) 
	warn: 'iwm->dbg.devdir' dereferencing possible ERR_PTR()

   440          iwm->dbg.devdir = debugfs_create_dir(devdir, iwm->dbg.rootdir);
   441          result = PTR_ERR(iwm->dbg.devdir);
   442          if (IS_ERR(iwm->dbg.devdir) && (result != -ENODEV)) {
   443                  IWM_ERR(iwm, "Couldn't create devdir: %d\n", result);
   444                  goto error;
   445          }
   446
   447          iwm->dbg.dbgdir = debugfs_create_dir("debug", iwm->dbg.devdir);

It looks like "iwm->dbg.devdir" could be ERR_PTR(-ENODEV) on line 447 and 
that would cause a problem inside debugfs_create_dir().  But at the same 
time -ENODEV was deliberately singled out as OK from other possible errors 
that debugfs_create_dir() can return.

I'm confused.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-26  3:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-22  9:59 bug report: potential ERR_PTR dereference in iwm_debugfs_init() Dan Carpenter
2010-04-23  2:48 ` Zhu Yi
2010-04-23 11:43   ` Dan Carpenter
2010-04-23 12:03     ` Johannes Berg
2010-04-26  3:22       ` Zhu Yi

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).