Skip to content

Commit

Permalink
ima: valid return code from ima_inode_alloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Paris authored and Al Viro committed Dec 16, 2009
1 parent e81e3f4 commit ec29ea5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions security/integrity/ima/ima_iint.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ struct ima_iint_cache *ima_iint_insert(struct inode *inode)
/**
* ima_inode_alloc - allocate an iint associated with an inode
* @inode: pointer to the inode
*
* Return 0 on success, 1 on failure.
*/
int ima_inode_alloc(struct inode *inode)
{
Expand All @@ -99,7 +97,7 @@ int ima_inode_alloc(struct inode *inode)

iint = ima_iint_insert(inode);
if (!iint)
return 1;
return -ENOMEM;
return 0;
}

Expand Down

0 comments on commit ec29ea5

Please sign in to comment.