aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ena
diff options
context:
space:
mode:
authorMarcin Wojtas <mw@FreeBSD.org>2019-05-30 13:26:18 +0000
committerMarcin Wojtas <mw@FreeBSD.org>2019-05-30 13:26:18 +0000
commit4e30699966e78ddcae7e46d0704822e7508072e3 (patch)
treeb442466aef0a04f9422e38907d98fd7eb2ab7877 /sys/dev/ena
parentc115a1e258fd7aa8cb6981c18f5d5be47841f86b (diff)
downloadsrc-4e30699966e78ddcae7e46d0704822e7508072e3.tar.gz
src-4e30699966e78ddcae7e46d0704822e7508072e3.zip
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 <mk@semihalf.com> Obtained from: Semihalf Sponsored by: Amazon, Inc.
Notes
Notes: svn path=/head/; revision=348400
Diffstat (limited to 'sys/dev/ena')
-rw-r--r--sys/dev/ena/ena.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c
index 89e176fc58b2..e72d61cbf357 100644
--- a/sys/dev/ena/ena.c
+++ b/sys/dev/ena/ena.c
@@ -1203,14 +1203,11 @@ validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id)
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);