diff --git a/fs/namei.c b/fs/namei.c index c9750d755aff63e8d4b5e3774998c5ff93cd22e7..e01070d7bf58a39e27a50ade9fcfd598574f43aa 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1712,8 +1712,14 @@ int open_namei(int dfd, const char *pathname, int flag, if (error) goto exit_dput; error = __do_follow_link(&path, nd); - if (error) + if (error) { + /* Does someone understand code flow here? Or it is only + * me so stupid? Anathema to whoever designed this non-sense + * with "intent.open". + */ + release_open_intent(nd); return error; + } nd->flags &= ~LOOKUP_PARENT; if (nd->last_type == LAST_BIND) goto ok;