[PATCH] coverity: fs/locks.c flp null check
[linux-2.6-block.git] / fs / locks.c
index a0bc03495bd44e23bfa89deb6c492ee2a9ccfcb8..29fa5da6c1170cab553b17b85eab000a2056793d 100644 (file)
@@ -1276,7 +1276,7 @@ int fcntl_getlease(struct file *filp)
  */
 static int __setlease(struct file *filp, long arg, struct file_lock **flp)
 {
-       struct file_lock *fl, **before, **my_before = NULL, *lease = *flp;
+       struct file_lock *fl, **before, **my_before = NULL, *lease;
        struct dentry *dentry = filp->f_dentry;
        struct inode *inode = dentry->d_inode;
        int error, rdlease_count = 0, wrlease_count = 0;
@@ -1287,6 +1287,8 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp)
        if (!flp || !(*flp) || !(*flp)->fl_lmops || !(*flp)->fl_lmops->fl_break)
                goto out;
 
+       lease = *flp;
+
        error = -EAGAIN;
        if ((arg == F_RDLCK) && (atomic_read(&inode->i_writecount) > 0))
                goto out;