Explorar o código

selinux: fix error codes in symtab_init()

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>
Dan Carpenter %!s(int64=15) %!d(string=hai) anos
pai
achega
9a7982793c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      security/selinux/ss/symtab.c

+ 1 - 1
security/selinux/ss/symtab.c

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