diff --git a/fs/namei.c b/fs/namei.c index c72b940797fc0321fcb6043610bc50138a2325ed..1baf1b06fe4793435e48f80c978469f8d39d08b2 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1628,6 +1628,12 @@ int open_namei(int dfd, const char *pathname, int flag, goto exit; } + if (IS_ERR(nd->intent.open.file)) { + mutex_unlock(&dir->d_inode->i_mutex); + error = PTR_ERR(nd->intent.open.file); + goto exit_dput; + } + /* Negative dentry, just create the file */ if (!path.dentry->d_inode) { if (!IS_POSIXACL(dir->d_inode))