Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 May 2019 13:26:18 +0000 (UTC)
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r348400 - head/sys/dev/ena
Message-ID:  <201905301326.x4UDQI7x066357@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <mk@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);



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