Date: Wed, 9 May 2012 15:25:59 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r235196 - stable/8/sys/netinet Message-ID: <201205091525.q49FPxkk090494@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Wed May 9 15:25:58 2012 New Revision: 235196 URL: http://svn.freebsd.org/changeset/base/235196 Log: MFC r235091: Address clang warnings. Modified: stable/8/sys/netinet/sctp_usrreq.c stable/8/sys/netinet/sctputil.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/8/sys/netinet/sctp_usrreq.c Wed May 9 15:23:33 2012 (r235195) +++ stable/8/sys/netinet/sctp_usrreq.c Wed May 9 15:25:58 2012 (r235196) @@ -5806,7 +5806,6 @@ sctp_ctloutput(struct socket *so, struct { void *optval = NULL; size_t optsize = 0; - struct sctp_inpcb *inp; void *p; int error = 0; @@ -5824,12 +5823,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); @@ -5844,7 +5842,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/8/sys/netinet/sctputil.c ============================================================================== --- stable/8/sys/netinet/sctputil.c Wed May 9 15:23:33 2012 (r235195) +++ stable/8/sys/netinet/sctputil.c Wed May 9 15:25:58 2012 (r235196) @@ -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; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201205091525.q49FPxkk090494>