Author: mmacy
Date: Fri May  4 18:59:01 2018
New Revision: 333259
URL: https://svnweb.freebsd.org/changeset/base/333259

Log:
  fix case where pidx_last might be used uninitialized
  
  Reviewed by:  sbruno

Modified:
  head/sys/dev/e1000/em_txrx.c

Modified: head/sys/dev/e1000/em_txrx.c
==============================================================================
--- head/sys/dev/e1000/em_txrx.c        Fri May  4 18:57:05 2018        
(r333258)
+++ head/sys/dev/e1000/em_txrx.c        Fri May  4 18:59:01 2018        
(r333259)
@@ -401,7 +401,7 @@ em_isc_txd_encap(void *arg, if_pkt_info_t pi)
         * needs End Of Packet (EOP)
         * and Report Status (RS)
         */
-       if (txd_flags) {
+       if (txd_flags && nsegs) {
                txr->tx_rsq[txr->tx_rs_pidx] = pidx_last;
                DPRINTF(iflib_get_dev(sc->ctx), "setting to RS on %d rs_pidx %d 
first: %d\n", pidx_last, txr->tx_rs_pidx, first);
                txr->tx_rs_pidx = (txr->tx_rs_pidx+1) & (ntxd-1);
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to