Skip to contentSkip to conversation

selinux: fix error codes in symtab_init()

PATCH Superseded Dan Carpenter 2 participants 2 messages Jun 7, 2010 – Jun 8, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 7/7 selinux: fix error codes in symtab_init()

hashtab_create() only returns NULL on allocation failures to -ENOMEM is appropriate here.

security/selinux/ss/symtab.c +1 -1
index bcf9f62..160326e 100644
@@ -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;
 }
Acked-by on v1 7/7
#1 lore raw
Quoted 4 lines · Dan Carpenter

hashtab_create() only returns NULL on allocation failures to -ENOMEM is appropriate here.

Quoted 7 lines
security/selinux/ss/symtab.c +0 -0
index bcf9f62..160326e 100644

security/selinux/ss/symtab.c int symtab_init(struct symtab *s, unsigned int size) · line 42

Quoted 8 lines
security/selinux/ss/symtab.c +1 -1
@@ -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;
  }

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html