All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: James Morris <jmorris@namei.org>,
	Eric Paris <eparis@parisplace.org>,
	selinux@tycho.nsa.gov
Subject: [patch 0/7 v2] selinux: return proper error codes instead of -1
Date: Sat, 12 Jun 2010 20:49:10 +0200	[thread overview]
Message-ID: <20100612184910.GO5483@bicker> (raw)

I've respun these patches based on Eric's feedback.  It was mostly to
use "rc" consistently instead of "ret" and also to use "if (rc)" instead
of "if (rc < 0)".

One thing which I didn't really change was in [patch 3/7].
On Tue, Jun 08, 2010 at 04:12:18PM -0400, Eric Paris wrote:
> I'm not in love with this one.  The change in cond_read_av_list() is
> fine, but the style and completeness in cond_insertf I think is even
> worse.  My biggest problem is the fact that you sent an error code at
> the top and just sorta leave it.  There are still lots of
>
> if (function())
>         goto err;
>
> which really should be
>
> rc = function()
> if (rc)
>         goto err;
>

The problem is those functions in cond_insertf() don't return error 
codes, they return pointers and NULL.  I could put an:

	rc = -EINVAL;

in front of each goto but that seems awkward.  I did change one of the
cond_insertf() returns to -ENOMEM where my first patch left it as
-EINVAL, but otherwise I basically left that function the same.

Everything else should be OK though.

regards,
dan carpenter


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

                 reply	other threads:[~2010-06-18 17:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100612184910.GO5483@bicker \
    --to=error27@gmail.com \
    --cc=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.