Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Feb 2004 17:45:17 -0800 (PST)
From:      "Ted Unangst" <tedu@coverity.com>
To:        hackers@freebsd.org
Subject:   redundant code bugs
Message-ID:  <19392.66.93.171.98.1077241517.spork@webmail.coverity.com>

next in thread | raw e-mail | index | archive | help
------=_20040219174517_23596
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

These are some more bugs from Coverity.  Most look like typos.
------=_20040219174517_23596
Content-Type: text/plain; name="report-red"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="report-red"



############################################################
# New errors.
#
---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/cam/cam_xpt.c|1885|xptdevicematch|ERROR|NOP| 1885|1885|Operation 'patterns == 0 || patterns == 0' is a redundant short-circuit or.


	/*
	 * If there are no match entries, then this device matches no
	 * matter what.
	 */

Error --->
	if ((patterns == NULL) || (patterns == 0))
		return(DM_RET_DESCEND | DM_RET_COPY);

	for (i = 0; i < num_patterns; i++) {
		struct device_match_pattern *cur_pattern;

---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/dev/asr/asr.c|3428|asr_intr|ERROR|NOP| 3428|3428|Operation 'ReplyOffset = (*(*sc).ha_Virt).FromFIFO == -1 && ReplyOffset = (*(*sc).ha_Virt).FromFIFO == -1' is a redundant short-circuit and.

	  processed = 1) {
		union asr_ccb			  * ccb;
		U32				    ReplyOffset;
		PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME Reply;


Error --->
		if (((ReplyOffset = sc->ha_Virt->FromFIFO) == EMPTY_QUEUE)
		 && ((ReplyOffset = sc->ha_Virt->FromFIFO) == EMPTY_QUEUE)) {
			break;
		}
		Reply = (PI2O_SCSI_ERROR_REPLY_MESSAGE_FRAME)(ReplyOffset
		  - sc->ha_Msgs_Phys + (char *)(sc->ha_Msgs));
---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/netsmb/smb_trantcp.c|611|smb_nbst_connect|ERROR|NOP| 611|611|Operation '(ts2).tv_sec == 0 && (ts2).tv_sec == 0' is a redundant short-circuit and.

	error = nb_connect_in(nbp, &sin, td);
	if (error)
		return error;
	getnanotime(&ts2);
	timespecsub(&ts2, &ts1);

Error --->
	if (ts2.tv_sec == 0 && ts2.tv_sec == 0)
		ts2.tv_sec = 1;
	nbp->nbp_timo = ts2;
	timespecadd(&nbp->nbp_timo, &ts2);
	timespecadd(&nbp->nbp_timo, &ts2);
	timespecadd(&nbp->nbp_timo, &ts2);	/*  * 4 */
---------------------------------------------------------
[UNINSPECTED]
X [BUG]
X [FALSE]
X [UNKNOWN]
X [BROKE]
X [SKIP]
/home/tedu/sys/contrib/ngatm/netnatm/sig/sig_call.c|3862|uni_sig_call|ERROR|NOP| 3862|3862|Operation '(*c).cstate == 11 || (*c).cstate == 11' is a redundant short-circuit or.

			/* Q.2971:Call-Control-U 13/39 (U6) */
			/* Q.2971:Call-Control-U 17/39 (U9) */
			unx_alerting_request(c, msg, cookie, CALLST_U7);
			break;
		}

Error --->
		if (c->cstate == CALLST_N1 || c->cstate == CALLST_N1) {
			/* Q.2971:Call-Control-N 38/39 (N1) */
			/* Q.2971:Call-Control-N 7/39  (N3) */
			unx_alerting_request(c, msg, cookie, CALLST_N4);
			break;
		}
------=_20040219174517_23596--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19392.66.93.171.98.1077241517.spork>