Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 May 2015 07:53:43 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282521 - head/sys/netpfil/ipfw
Message-ID:  <201505060753.t467rh9v032816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: melifaro
Date: Wed May  6 07:53:43 2015
New Revision: 282521
URL: https://svnweb.freebsd.org/changeset/base/282521

Log:
  Fix panic when prepare_batch_buffer() returns error.

Modified:
  head/sys/netpfil/ipfw/ip_fw_table.c

Modified: head/sys/netpfil/ipfw/ip_fw_table.c
==============================================================================
--- head/sys/netpfil/ipfw/ip_fw_table.c	Wed May  6 05:40:20 2015	(r282520)
+++ head/sys/netpfil/ipfw/ip_fw_table.c	Wed May  6 07:53:43 2015	(r282521)
@@ -597,19 +597,21 @@ restart:
 	/* Pass stack buffer by default */
 	ta_buf_m = ta_buf;
 	error = prepare_batch_buffer(ch, ta, tei, count, OP_ADD, &ta_buf_m);
-	if (error != 0)
-		goto cleanup;
 
 	IPFW_UH_WLOCK(ch);
+	del_toperation_state(ch, &ts);
 	/* Drop reference we've used in first search */
 	tc->no.refcnt--;
 
+	/* Check prepare_batch_buffer() error */
+	if (error != 0)
+		goto cleanup;
+
 	/*
 	 * Check if table swap has happened.
 	 * (so table algo might be changed).
 	 * Restart operation to achieve consistent behavior.
 	 */
-	del_toperation_state(ch, &ts);
 	if (ts.modified != 0)
 		goto restart;
 



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