Address clang warnings.
MFC after: 3 days
This commit is contained in:
parent
e06b67c756
commit
8c501e516b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=235091
@ -5838,7 +5838,6 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt)
|
||||
{
|
||||
void *optval = NULL;
|
||||
size_t optsize = 0;
|
||||
struct sctp_inpcb *inp;
|
||||
void *p;
|
||||
int error = 0;
|
||||
|
||||
@ -5856,12 +5855,11 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt)
|
||||
#endif
|
||||
return (error);
|
||||
}
|
||||
inp = (struct sctp_inpcb *)so->so_pcb;
|
||||
optsize = sopt->sopt_valsize;
|
||||
if (optsize) {
|
||||
SCTP_MALLOC(optval, void *, optsize, SCTP_M_SOCKOPT);
|
||||
if (optval == NULL) {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS);
|
||||
SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOBUFS);
|
||||
return (ENOBUFS);
|
||||
}
|
||||
error = sooptcopyin(sopt, optval, optsize, optsize);
|
||||
@ -5876,7 +5874,7 @@ sctp_ctloutput(struct socket *so, struct sockopt *sopt)
|
||||
} else if (sopt->sopt_dir == SOPT_GET) {
|
||||
error = sctp_getopt(so, sopt->sopt_name, optval, &optsize, p);
|
||||
} else {
|
||||
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
SCTP_LTRACE_ERR_RET(so->so_pcb, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
|
||||
error = EINVAL;
|
||||
}
|
||||
if ((error == 0) && (optval != NULL)) {
|
||||
|
@ -3288,7 +3288,8 @@ sctp_notify_stream_reset_add(struct sctp_tcb *stcb, uint16_t numberin, uint16_t
|
||||
struct sctp_stream_change_event *stradd;
|
||||
int len;
|
||||
|
||||
if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT)) {
|
||||
if ((stcb == NULL) ||
|
||||
(sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_CHANGEEVNT))) {
|
||||
/* event not enabled */
|
||||
return;
|
||||
}
|
||||
@ -3349,7 +3350,8 @@ sctp_notify_stream_reset_tsn(struct sctp_tcb *stcb, uint32_t sending_tsn, uint32
|
||||
struct sctp_assoc_reset_event *strasoc;
|
||||
int len;
|
||||
|
||||
if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT)) {
|
||||
if ((stcb == NULL) ||
|
||||
(sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_ASSOC_RESETEVNT))) {
|
||||
/* event not enabled */
|
||||
return;
|
||||
}
|
||||
@ -3407,7 +3409,8 @@ sctp_notify_stream_reset(struct sctp_tcb *stcb,
|
||||
struct sctp_stream_reset_event *strreset;
|
||||
int len;
|
||||
|
||||
if (sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT)) {
|
||||
if ((stcb == NULL) ||
|
||||
(sctp_stcb_is_feature_off(stcb->sctp_ep, stcb, SCTP_PCB_FLAGS_STREAM_RESETEVNT))) {
|
||||
/* event not enabled */
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user