From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Paul Aitken <paitken@brocade.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] Optimise nfq_queue_cb
Date: Mon, 1 Jun 2015 13:03:59 +0200 [thread overview]
Message-ID: <20150601110359.GB4002@salvia> (raw)
In-Reply-To: <556C2438.3060203@brocade.com>
On Mon, Jun 01, 2015 at 10:22:00AM +0100, Paul Aitken wrote:
> ct and myct have both already been checked for non-NULL,
> so there's no need to check either of them again later.
>
> Signed-off-by: Paul Aitken <paitken@brocade.com>
> ---
> src/cthelper.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/src/cthelper.c b/src/cthelper.c
> index 15d5126..6537515 100644
> --- a/src/cthelper.c
> +++ b/src/cthelper.c
> @@ -325,14 +325,12 @@ static int nfq_queue_cb(const struct nlmsghdr *nlh, void *data)
> if (pkt_verdict_issue(helper, myct, queue_num, id, verdict, pktb) < 0)
> goto err_pktb;
> - if (ct != NULL)
> - nfct_destroy(ct);
> + nfct_destroy(ct);
void nfct_destroy(struct nf_conntrack *ct)
{
assert(ct != NULL);
...
the library doesn't allow NULL pointers.
> if (myct->exp != NULL)
> nfexp_destroy(myct->exp);
> - if (myct && myct->priv_data != NULL)
> + if (myct->priv_data != NULL)
> free(myct->priv_data);
> - if (myct != NULL)
> - free(myct);
> + free(myct);
> return MNL_CB_OK;
> err_pktb:
> --
> 1.9.1
>
next prev parent reply other threads:[~2015-06-01 10:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <md5:KJl5IfCAjtPWb+o93HAjWA==>
2015-06-01 9:22 ` [PATCH] Optimise nfq_queue_cb Paul Aitken
2015-06-01 11:03 ` Pablo Neira Ayuso [this message]
2015-06-01 11:19 ` Paul Aitken
2015-06-01 17:34 ` Pablo Neira Ayuso
2015-06-04 9:13 ` Paul Aitken
2015-06-04 9:15 Paul Aitken
2015-06-12 13:08 ` Pablo Neira Ayuso
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=20150601110359.GB4002@salvia \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=paitken@brocade.com \
/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.