From: David Miller <davem@davemloft.net>
To: dborkman@redhat.com
Cc: netdev@vger.kernel.org, linux-sctp@vger.kernel.org,
davej@redhat.com, dan.carpenter@oracle.com
Subject: Re: [PATCH net-next] net: sctp: remove NULL check in sctp_assoc_update_retran_path
Date: Thu, 13 Mar 2014 13:24:46 -0400 (EDT) [thread overview]
Message-ID: <20140313.132446.1003026026338152564.davem@davemloft.net> (raw)
In-Reply-To: <1394718326-6415-1-git-send-email-dborkman@redhat.com>
From: Daniel Borkmann <dborkman@redhat.com>
Date: Thu, 13 Mar 2014 14:45:26 +0100
> This is basically just to let Coverity et al shut up. Remove an
> unneeded NULL check in sctp_assoc_update_retran_path().
>
> It is safe to remove it, because in sctp_assoc_update_retran_path()
> we iterate over the list of transports, our own transport which is
> asoc->peer.retran_path included. In the iteration, we skip the
> list head element and transports in state SCTP_UNCONFIRMED.
>
> Such transports came from peer addresses received in INIT/INIT-ACK
> address parameters. They are not yet confirmed by a heartbeat and
> not available for data transfers.
>
> We know however that in the list of transports, even if it contains
> such elements, it at least contains our asoc->peer.retran_path as
> well, so even if next to that element, we only encounter
> SCTP_UNCONFIRMED transports, we are always going to fall back to
> asoc->peer.retran_path through sctp_trans_elect_best(), as that is
> for sure not SCTP_UNCONFIRMED as per fbdf501c9374 ("sctp: Do no
> select unconfirmed transports for retransmissions").
>
> Whenever we call sctp_trans_elect_best() it will give us a non-NULL
> element back, and therefore when we break out of the loop, we are
> guaranteed to have a non-NULL transport pointer, and can remove
> the NULL check.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Reported-by: Dave Jones <davej@redhat.com>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Applied, thanks Daniel.
prev parent reply other threads:[~2014-03-13 17:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 13:45 [PATCH net-next] net: sctp: remove NULL check in sctp_assoc_update_retran_path Daniel Borkmann
2014-03-13 17:24 ` David Miller [this message]
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=20140313.132446.1003026026338152564.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dan.carpenter@oracle.com \
--cc=davej@redhat.com \
--cc=dborkman@redhat.com \
--cc=linux-sctp@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).