--- linux-2.6.16-w/fs/namei.c 2006-07-10 11:43:11.000000000 +0400 +++ linux-2.6.16/fs/namei.c 2006-07-10 11:53:36.000000000 +0400 @@ -1774,8 +1774,15 @@ do_link: 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". + */ + if (!IS_ERR(nd->intent.open.file)) + release_open_intent(nd); return error; + } nd->flags &= ~LOOKUP_PARENT; if (nd->last_type == LAST_BIND) goto ok;