f2fs: remove unneeded condition
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 16 Dec 2016 08:18:15 +0000 (11:18 +0300)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sun, 29 Jan 2017 03:46:00 +0000 (12:46 +0900)
We checked that "inode" is not an error pointer earlier so there is
no need to check again here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/namei.c

index 56c19b0610a899a6351f72a16e26b788f956e3d5..290a9d7060efef7c11148f46738215777c12a04e 100644 (file)
@@ -321,9 +321,9 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
                if (err)
                        goto err_out;
        }
-       if (!IS_ERR(inode) && f2fs_encrypted_inode(dir) &&
-                       (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
-                       !fscrypt_has_permitted_context(dir, inode)) {
+       if (f2fs_encrypted_inode(dir) &&
+           (S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) &&
+           !fscrypt_has_permitted_context(dir, inode)) {
                bool nokey = f2fs_encrypted_inode(inode) &&
                        !fscrypt_has_encryption_key(inode);
                err = nokey ? -ENOKEY : -EPERM;