linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: locks: new locks_mandatory_area calling convention
@ 2015-12-08  6:14 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-12-08  6:14 UTC (permalink / raw)
  To: hch; +Cc: linux-fsdevel

Hello Christoph Hellwig,

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

The patch 9e48b0c90a29: "locks: new locks_mandatory_area calling 
convention" from Dec 3, 2015, leads to the following Smatch complaint:

fs/locks.c:1250 locks_mandatory_area()
	 warn: variable dereferenced before check 'filp' (see line 1241)

fs/locks.c
  1240	{
  1241		struct inode *inode = file_inode(filp);
                                      ^^^^^^^^^^^^^^^^
Patch adds new dereference inside the function call.

  1242		struct file_lock fl;
  1243		int error;
  1244		bool sleep = false;
  1245	
  1246		locks_init_lock(&fl);
  1247		fl.fl_pid = current->tgid;
  1248		fl.fl_file = filp;
  1249		fl.fl_flags = FL_POSIX | FL_ACCESS;
  1250		if (filp && !(filp->f_flags & O_NONBLOCK))
                    ^^^^
Existing check is too late.

  1251			sleep = true;
  1252		fl.fl_type = type;

regards,
dan carpenter

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

only message in thread, other threads:[~2015-12-08  6:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-08  6:14 locks: new locks_mandatory_area calling convention 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).