Cleanup the code.

Reported by:	Coverity
CID:		1232003
This commit is contained in:
tuexen 2014-12-20 13:47:38 +00:00
parent a4ebd43b45
commit 6ea79eb488

View File

@ -3643,12 +3643,6 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize,
(sid < stcb->asoc.streamoutcnt) &&
((policy == SCTP_PR_SCTP_ALL) ||
(PR_SCTP_VALID_POLICY(policy)))) {
#else
if ((stcb != NULL) &&
(policy != SCTP_PR_SCTP_NONE) &&
(sid < stcb->asoc.streamoutcnt) &&
(policy == SCTP_PR_SCTP_ALL)) {
#endif
if (policy == SCTP_PR_SCTP_ALL) {
sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0];
sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0];
@ -3656,6 +3650,13 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize,
sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[policy];
sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[policy];
}
#else
if ((stcb != NULL) &&
(policy == SCTP_PR_SCTP_ALL) &&
(sid < stcb->asoc.streamoutcnt)) {
sprstat->sprstat_abandoned_unsent = stcb->asoc.strmout[sid].abandoned_unsent[0];
sprstat->sprstat_abandoned_sent = stcb->asoc.strmout[sid].abandoned_sent[0];
#endif
SCTP_TCB_UNLOCK(stcb);
*optsize = sizeof(struct sctp_prstatus);
} else {