diff --git a/fs/namei.c b/fs/namei.c index f624d132e01e6f5488fd0d9af13007b015e1e178..e30deefad8f8718aa4ca75c42501da60f3e1942e 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3273,6 +3273,10 @@ static int do_last(struct nameidata *nd, goto exit_fput; } out: + if (unlikely(error > 0)) { + WARN_ON(1); + error = -EINVAL; + } if (got_write) mnt_drop_write(nd->path.mnt); path_put(&save_parent);