All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Lautrbach <lautrbach@redhat.com>
To: Daniel Burgener <dburgener@linux.microsoft.com>,
	James Carter <jwcart2@gmail.com>
Cc: selinux@vger.kernel.org
Subject: Re: [PATCH 1/9] libsepol/cil: Use struct cil_db * instead of void *
Date: Wed, 01 Nov 2023 10:45:04 +0100	[thread overview]
Message-ID: <87a5rxhknz.fsf@redhat.com> (raw)
In-Reply-To: <2c0b5552-84b8-fe63-6d4c-0a42c7b8a753@linux.microsoft.com>

Daniel Burgener <dburgener@linux.microsoft.com> writes:

> On 9/27/2023 4:41 PM, James Carter wrote:
>> On Wed, Sep 27, 2023 at 3:27 PM Daniel Burgener
>> <dburgener@linux.microsoft.com> wrote:
>>>
>>>> @@ -3661,21 +3615,17 @@ static int cil_check_for_bad_inheritance(struct cil_tree_node *node)
>>>>        return rc;
>>>>    }
>>>>
>>>> -static int __cil_resolve_ast_node(struct cil_tree_node *node, void *extra_args)
>>>> +static int __cil_resolve_ast_node(struct cil_tree_node *node, struct cil_args_resolve *args)
>>>>    {
>>>>        int rc = SEPOL_OK;
>>>> -     struct cil_args_resolve *args = extra_args;
>>>> +     struct cil_db *db = args->db;
>>>>        enum cil_pass pass = 0;
>>>>
>>>> -     if (node == NULL || args == NULL) {
>>>> -             goto exit;
>>>> -     }
>>>> -
>>>
>>> Is deleting the "node == NULL" part of this check intended here?  It
>>> seems unrelated to the rest of the commit, and it's not locally obvious
>>> that it's safe.
>> 
>> You are right. It is not related to the rest of the commit. There are
>> a bunch of these sorts of checks that are useless and really annoy me.
>> The function __cil_resolve_ast_node() is called once from
>> __cil_resolve_ast_node_helper() and neither node nor args can be NULL.
>> Since I was changing something nearby, I guess I couldn't resist. I
>> can leave it in, if people prefer. It doesn't cause any harm, other
>> than annoying me.
>> 
>
> As is is fine by me.  Your explanation makes sense.  I mostly wanted to 
> make sure it was reasoned out rather than an accidental drop, but now 
> that you point it out, it does look impossible for this to be NULL.
>
> Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com>

Acked-by: Petr Lautrbach <lautrbach@redhat.com>


Petr


  reply	other threads:[~2023-11-01  9:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27 19:00 [PATCH 0/9] CIL Cleanups and Improved Argument handling James Carter
2023-09-27 19:00 ` [PATCH 1/9] libsepol/cil: Use struct cil_db * instead of void * James Carter
2023-09-27 19:27   ` Daniel Burgener
2023-09-27 20:41     ` James Carter
2023-09-28 17:10       ` Daniel Burgener
2023-11-01  9:45         ` Petr Lautrbach [this message]
2023-11-17 15:29           ` James Carter
2023-11-21 14:10             ` James Carter
2023-09-27 19:00 ` [PATCH 2/9] libsepol/cil: Refactor and improve handling of order rules James Carter
2023-09-27 19:00 ` [PATCH 3/9] libsepol/cil: Allow IP address and mask values to be directly written James Carter
2023-09-27 19:00 ` [PATCH 4/9] secilc/docs: Update syntax for IP addresses and nodecon James Carter
2023-09-27 19:00 ` [PATCH 5/9] libsepol/cil: Refactor Named Type Transition Filename Creation James Carter
2023-09-27 19:00 ` [PATCH 6/9] libsepol/cil: Allow paths in filecon rules to be passed as arguments James Carter
2023-09-27 19:00 ` [PATCH 7/9] secilc/docs: Fix and update the documentation for macro parameters James Carter
2023-09-27 19:00 ` [PATCH 8/9] libsepol/cil: Add pointers to datums to improve writing out AST James Carter
2023-09-27 19:00 ` [PATCH 9/9] libsepol/cil: Give warning for name that has different flavor James Carter

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=87a5rxhknz.fsf@redhat.com \
    --to=lautrbach@redhat.com \
    --cc=dburgener@linux.microsoft.com \
    --cc=jwcart2@gmail.com \
    --cc=selinux@vger.kernel.org \
    /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.