[PATCH]:Return proper error value on failure of dentry_open
From: vibi sreenivasan
Date: Mon Jun 01 2009 - 02:25:22 EST
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@xxxxxxx>
---
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/