public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: vibi sreenivasan <vibi_sreenivasan@cms.com>
To: Jiri Slaby <jirislaby@gmail.com>
Cc: Mimi Zohar <zohar@us.ibm.com>, Kylene Hall <kylene@us.ibm.com>,
	Serge Hallyn <serue@us.ibm.com>,
	Reiner Sailer <sailer@watson.ibm.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH]:RESEND : Return proper error value on failure of dentry_open
Date: Mon, 01 Jun 2009 13:57:29 +0530	[thread overview]
Message-ID: <1243844849.2327.27.camel@system> (raw)
In-Reply-To: <4A238625.8060002@gmail.com>

    dentry_open can return error value on error.
    Check that value before calling fput & return proper error value

Signed-off-by: vibi sreenivasan <vibi_sreenivasan@cms.com>
---
 security/integrity/ima/ima_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index f4e7266..c58158b 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -201,10 +201,10 @@ int ima_path_check(struct path *path, int mask)
 	}
 out:
 	mutex_unlock(&iint->mutex);
-	if (file)
+	if (!IS_ERR(file))
 		fput(file);
 	kref_put(&iint->refcount, iint_free);
-	return 0;
+	return rc;
 }
 
 static int process_measurement(struct file *file, const unsigned char *filename,
-- 
1.6.0




  parent reply	other threads:[~2009-06-01  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-01  6:11 [PATCH]:Return proper error value on failure of dentry_open vibi sreenivasan
2009-06-01  7:41 ` Jiri Slaby
2009-06-01  8:10   ` vibi sreenivasan
2009-06-01  8:27   ` vibi sreenivasan [this message]
2009-06-01  8:39     ` [PATCH]:RESEND : Return " Jiri Slaby
2009-06-02  5:21       ` Andrew Morton
2009-06-02  5:35         ` vibi sreenivasan
2009-06-01 20:37 ` [PATCH]:Return " Jon Masters

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=1243844849.2327.27.camel@system \
    --to=vibi_sreenivasan@cms.com \
    --cc=jirislaby@gmail.com \
    --cc=kylene@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sailer@watson.ibm.com \
    --cc=serue@us.ibm.com \
    --cc=zohar@us.ibm.com \
    /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