From: Dan Carpenter Date: Sat, 12 Jun 2010 18:50:35 +0000 (+0200) Subject: selinux: cleanup return codes in avtab_read_item() X-Git-Tag: v2.6.36-rc1~584^2~33 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e0bd4cba4460bff64fb07cfb07849cdfd4d325a;p=pandora-kernel.git selinux: cleanup return codes in avtab_read_item() The avtab_read_item() function tends to return -1 as a default error code which is wrong (-1 means -EPERM). I modified it to return appropriate error codes which is -EINVAL or the error code from next_entry() or insertf(). next_entry() returns -EINVAL. insertf() is a function pointer to either avtab_insert() or cond_insertf(). avtab_insert() returns -EINVAL, -ENOMEM, and -EEXIST. cond_insertf() currently returns -1, but I will fix it in a later patch. There is code in avtab_read() which translates the -1 returns from avtab_read_item() to -EINVAL. The translation is no longer needed, so I removed it. Signed-off-by: Dan Carpenter Acked-by: Stephen D. Smalley Signed-off-by: James Morris --- Reading git-diff-tree failed