public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]:Return proper error value on failure of dentry_open
@ 2009-06-01  6:11 vibi sreenivasan
  2009-06-01  7:41 ` Jiri Slaby
  2009-06-01 20:37 ` [PATCH]:Return " Jon Masters
  0 siblings, 2 replies; 8+ messages in thread
From: vibi sreenivasan @ 2009-06-01  6:11 UTC (permalink / raw)
  To: Mimi Zohar; +Cc: Kylene Hall, Serge Hallyn, Reiner Sailer, linux-kernel

    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




^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-06-02  5:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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   ` [PATCH]:RESEND : Return " vibi sreenivasan
2009-06-01  8:39     ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox