svn commit: r235176 - stable/9/sys/netinet
Michael Tuexen
tuexen at FreeBSD.org
Wed May 9 14:27:42 UTC 2012
Author: tuexen
Date: Wed May 9 14:27:42 2012
New Revision: 235176
URL: http://svn.freebsd.org/changeset/base/235176
Log:
MFC r235091:
Address clang warnings.
Modified:
stable/9/sys/netinet/sctp_usrreq.c
stable/9/sys/netinet/sctputil.c
Directory Properties:
stable/9/sys/ (props changed)
Modified: stable/9/sys/netinet/sctp_usrreq.c
==============================================================================
--- stable/9/sys/netinet/sctp_usrreq.c Wed May 9 14:25:15 2012 (r235175)
+++ stable/9/sys/netinet/sctp_usrreq.c Wed May 9 14:27:42 2012 (r235176)
@@ -5838,7 +5838,6 @@ sctp_ctloutput(struct socket *so, struct
{
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
#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
} 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)) {
Modified: stable/9/sys/netinet/sctputil.c
==============================================================================
--- stable/9/sys/netinet/sctputil.c Wed May 9 14:25:15 2012 (r235175)
+++ stable/9/sys/netinet/sctputil.c Wed May 9 14:27:42 2012 (r235176)
@@ -3288,7 +3288,8 @@ sctp_notify_stream_reset_add(struct sctp
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
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
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;
}
More information about the svn-src-stable-9
mailing list