Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Sep 2019 14:07:24 -0000
From:      Kristof Provost <kp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r346349 - head/sys/netpfil/pf
Message-ID:  <201904181137.x3IBbivn072232@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kp
Date: Thu Apr 18 11:37:44 2019
New Revision: 346349
URL: https://svnweb.freebsd.org/changeset/base/346349

Log:
  pf: No need to M_NOWAIT in DIOCRSETTFLAGS
  
  Now that we don't hold a lock during DIOCRSETTFLAGS memory allocation we can
  use M_WAITOK.
  
  MFC after:	1 week
  Event:		Aberdeen hackathon 2019
  Pointed out by:	glebius@

Modified:
  head/sys/netpfil/pf/pf_ioctl.c

Modified: head/sys/netpfil/pf/pf_ioctl.c
==============================================================================
--- head/sys/netpfil/pf/pf_ioctl.c	Thu Apr 18 11:06:45 2019	(r346348)
+++ head/sys/netpfil/pf/pf_ioctl.c	Thu Apr 18 11:37:44 2019	(r346349)
@@ -3110,11 +3110,7 @@ DIOCCHANGEADDR_error:
 
 		totlen = io->pfrio_size * sizeof(struct pfr_table);
 		pfrts = mallocarray(io->pfrio_size, sizeof(struct pfr_table),
-		    M_TEMP, M_NOWAIT);
-		if (pfrts == NULL) {
-			error = ENOMEM;
-			break;
-		}
+		    M_TEMP, M_WAITOK);
 		error = copyin(io->pfrio_buffer, pfrts, totlen);
 		if (error) {
 			free(pfrts, M_TEMP);





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