Re: [patch 6/7] selinux: fix error codes in cond_read_bool()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 7, 2010 at 5:10 PM, Dan Carpenter <error27@xxxxxxxxx> wrote:
> The original code always returned -1 (-EPERM) on error.  The new code
> returns either -ENOMEM, or -EINVAL or it propagates the error codes from
> lower level functions next_entry() or hashtab_insert().
>
> next_entry() returns -EINVAL.
> hashtab_insert() returns -EINVAL, -EEXIST, or -ENOMEM.
>
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
>
> diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
> index 7447be0..dc5db55 100644
> --- a/security/selinux/ss/conditional.c
> +++ b/security/selinux/ss/conditional.c

> @@ -244,13 +246,14 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp)
>        if (rc < 0)
>                goto err;
>        key[len] = '\0';
> -       if (hashtab_insert(h, key, booldatum))
> +       rc = hashtab_insert(h, key, booldatum);
> +       if (rc < 0)

If James wants to pull this one I'm ok with it, but I much prefer if (rc)

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


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux