[PATCH -next] integrity: fix the error return code in integrity_load_keys()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The error return code PTR_ERR(integrity_dir) is always 0 since
integrity_dir is set to NULL in this error handling case.

Fixes: 0c343af8065b ("integrity: Add an integrity directory in securityfs")
Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
---
 security/integrity/iint.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 149faa8..2dfc9e8 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -217,12 +217,15 @@ void __init integrity_load_keys(void)
 
 static int __init integrity_fs_init(void)
 {
+	int ret;
+
 	integrity_dir = securityfs_create_dir("integrity", NULL);
 	if (IS_ERR(integrity_dir)) {
 		pr_err("Unable to create integrity sysfs dir: %ld\n",
 		       PTR_ERR(integrity_dir));
+		ret = PTR_ERR(integrity_dir);
 		integrity_dir = NULL;
-		return PTR_ERR(integrity_dir);
+		return ret;
 	}
 
 	return 0;

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux