瀏覽代碼

ima: valid return code from ima_inode_alloc

ima_inode_alloc returns 0 and 1, but the LSM hooks expects an errno.

Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Eric Paris 16 年之前
父節點
當前提交
ec29ea544b
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      security/integrity/ima/ima_iint.c

+ 1 - 3
security/integrity/ima/ima_iint.c

@@ -87,8 +87,6 @@ struct ima_iint_cache *ima_iint_insert(struct inode *inode)
 /**
 /**
  * ima_inode_alloc - allocate an iint associated with an inode
  * ima_inode_alloc - allocate an iint associated with an inode
  * @inode: pointer to the inode
  * @inode: pointer to the inode
- *
- * Return 0 on success, 1 on failure.
  */
  */
 int ima_inode_alloc(struct inode *inode)
 int ima_inode_alloc(struct inode *inode)
 {
 {
@@ -99,7 +97,7 @@ int ima_inode_alloc(struct inode *inode)
 
 
 	iint = ima_iint_insert(inode);
 	iint = ima_iint_insert(inode);
 	if (!iint)
 	if (!iint)
-		return 1;
+		return -ENOMEM;
 	return 0;
 	return 0;
 }
 }