svn commit: r357159 - head/sys/dev/netmap

Vincenzo Maffione vmaffione at FreeBSD.org
Sun Jan 26 21:34:47 UTC 2020


Author: vmaffione
Date: Sun Jan 26 21:34:46 2020
New Revision: 357159
URL: https://svnweb.freebsd.org/changeset/base/357159

Log:
  netmap_mem_unmap: fix NULL pointer dereference
  
  MFC after:	3 days

Modified:
  head/sys/dev/netmap/netmap_mem2.c

Modified: head/sys/dev/netmap/netmap_mem2.c
==============================================================================
--- head/sys/dev/netmap/netmap_mem2.c	Sun Jan 26 20:57:29 2020	(r357158)
+++ head/sys/dev/netmap/netmap_mem2.c	Sun Jan 26 21:34:46 2020	(r357159)
@@ -1523,11 +1523,12 @@ static int
 netmap_mem_unmap(struct netmap_obj_pool *p, struct netmap_adapter *na)
 {
 	int i, lim = p->objtotal;
-	struct netmap_lut *lut = &na->na_lut;
+	struct netmap_lut *lut;
 
 	if (na == NULL || na->pdev == NULL)
 		return 0;
 
+	lut = &na->na_lut;
 #if defined(__FreeBSD__)
 	/* On FreeBSD mapping and unmapping is performed by the txsync
 	 * and rxsync routine, packet by packet. */


More information about the svn-src-all mailing list