All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 7/7] selinux: fix error codes in symtab_init()
@ 2010-06-07 21:11 Dan Carpenter
  2010-06-08 20:22 ` Eric Paris
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-06-07 21:11 UTC (permalink / raw)
  To: kernel-janitors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/security/selinux/ss/symtab.c b/security/selinux/ss/symtab.c
index bcf9f62..160326e 100644
--- a/security/selinux/ss/symtab.c
+++ b/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);
 	if (!s->table)
-		return -1;
+		return -ENOMEM;
 	s->nprim = 0;
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch 7/7] selinux: fix error codes in symtab_init()
  2010-06-07 21:11 [patch 7/7] selinux: fix error codes in symtab_init() Dan Carpenter
@ 2010-06-08 20:22 ` Eric Paris
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Paris @ 2010-06-08 20:22 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Jun 7, 2010 at 5:11 PM, Dan Carpenter <error27@gmail.com> wrote:
> 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>

>
> diff --git a/security/selinux/ss/symtab.c b/security/selinux/ss/symtab.c
> index bcf9f62..160326e 100644
> --- a/security/selinux/ss/symtab.c
> +++ b/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);
>        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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-08 20:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-07 21:11 [patch 7/7] selinux: fix error codes in symtab_init() Dan Carpenter
2010-06-08 20:22 ` Eric Paris

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.