diff options
author | melifaro <melifaro@FreeBSD.org> | 2015-05-06 07:53:43 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2015-05-06 07:53:43 +0000 |
commit | 7576d0f7a1522b8f4cf95e6d9500b7c856ac65c1 (patch) | |
tree | 4fdc8a5c6b9b968d6cd38c972869777d7fc99d7b /sys/netpfil | |
parent | e5110c0076d89c942bf5906f97d3ef259fdfab5d (diff) | |
download | FreeBSD-src-7576d0f7a1522b8f4cf95e6d9500b7c856ac65c1.zip FreeBSD-src-7576d0f7a1522b8f4cf95e6d9500b7c856ac65c1.tar.gz |
Fix panic when prepare_batch_buffer() returns error.
Diffstat (limited to 'sys/netpfil')
-rw-r--r-- | sys/netpfil/ipfw/ip_fw_table.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_table.c b/sys/netpfil/ipfw/ip_fw_table.c index ca4e0e4..f942541 100644 --- a/sys/netpfil/ipfw/ip_fw_table.c +++ b/sys/netpfil/ipfw/ip_fw_table.c @@ -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; |