Author: mw
Date: Thu May 30 13:26:18 2019
New Revision: 348400
URL: https://svnweb.freebsd.org/changeset/base/348400

Log:
  Fix error in validate_tx_req_id() in ENA
  
  If the requested ID was out of range, the tx_info structure was NULL and
  the function was trying to access the field of the NULL object.
  
  Submitted by:  Michal Krawczyk <m...@semihalf.com>
  Obtained from: Semihalf
  Sponsored by:  Amazon, Inc.

Modified:
  head/sys/dev/ena/ena.c

Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c      Thu May 30 13:24:47 2019        (r348399)
+++ head/sys/dev/ena/ena.c      Thu May 30 13:26:18 2019        (r348400)
@@ -1203,14 +1203,11 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t 
                tx_info = &tx_ring->tx_buffer_info[req_id];
                if (tx_info->mbuf != NULL)
                        return (0);
-       }
-
-       if (tx_info->mbuf == NULL)
                device_printf(adapter->pdev,
                    "tx_info doesn't have valid mbuf\n");
-       else
-               device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id);
+       }
 
+       device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id);
        counter_u64_add(tx_ring->tx_stats.bad_req_id, 1);
 
        return (EFAULT);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to