linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasikanth V <sasikanth.v19@gmail.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sasikanth V <sasikanth.v19@gmail.com>
Subject: [PATCH] fs: uselib - Set error on do_filp_open failure only
Date: Sun, 22 Apr 2012 03:19:43 +0530	[thread overview]
Message-ID: <1335044983-2908-1-git-send-email-sasikanth.v19@gmail.com> (raw)

At present "error" is set irrespective of do_filp_open failed or not.
Setting error to PTR_ERR(file) on do_filp_open failure only.

Signed-off-by: Sasikanth V <sasikanth.v19@gmail.com>
---
 fs/exec.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index b1fd202..cb43367 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -129,9 +129,10 @@ SYSCALL_DEFINE1(uselib, const char __user *, library)
 
 	file = do_filp_open(AT_FDCWD, tmp, &uselib_flags, LOOKUP_FOLLOW);
 	putname(tmp);
-	error = PTR_ERR(file);
-	if (IS_ERR(file))
+	if (IS_ERR(file)) {
+		error = PTR_ERR(file);
 		goto out;
+	}
 
 	error = -EINVAL;
 	if (!S_ISREG(file->f_path.dentry->d_inode->i_mode))
-- 
1.7.3.4

             reply	other threads:[~2012-04-21 21:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21 21:49 Sasikanth V [this message]
2012-04-21 22:00 ` [PATCH] fs: uselib - Set error on do_filp_open failure only Jesper Juhl
2012-04-21 22:09 ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1335044983-2908-1-git-send-email-sasikanth.v19@gmail.com \
    --to=sasikanth.v19@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).