selinux: fix error codes in symtab_init()
authorDan Carpenter <error27@gmail.com>
Sat, 12 Jun 2010 18:57:39 +0000 (20:57 +0200)
committerJames Morris <jmorris@namei.org>
Mon, 2 Aug 2010 05:35:04 +0000 (15:35 +1000)
hashtab_create() only returns NULL on allocation failures to -ENOMEM is
appropriate here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Eric Paris <eparis@redhat.com>
Acked-by: Stephen D. Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
security/selinux/ss/symtab.c

index bcf9f62..160326e 100644 (file)
@@ -36,7 +36,7 @@ int symtab_init(struct symtab *s, unsigned int size)
 {
        s->table = hashtab_create(symhash, symcmp, size);
        if (!s->table)
-               return -1;
+               return -ENOMEM;
        s->nprim = 0;
        return 0;
 }