Fix panic when prepare_batch_buffer() returns error.
This commit is contained in:
parent
ea91ca92ba
commit
b45fa3fad6
@ -597,19 +597,21 @@ add_table_entry(struct ip_fw_chain *ch, struct tid_info *ti,
|
||||
/* 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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user