[EBTABLES]: vfree() checking cleanups

From: jlamanna@gmail.com

ebtables.c vfree() checking cleanups.

Signed-off by: James Lamanna <jlamanna@gmail.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
James Lamanna 2005-06-22 22:12:57 -07:00 коммит произвёл David S. Miller
Родитель 285b3afefa
Коммит 68d3187200
1 изменённых файлов: 7 добавлений и 14 удалений

Просмотреть файл

@ -859,7 +859,6 @@ static int translate_table(struct ebt_replace *repl,
if (repl->valid_hooks & (1 << i))
if (check_chainloops(newinfo->hook_entry[i],
cl_s, udc_cnt, i, newinfo->entries)) {
if (cl_s)
vfree(cl_s);
return -EINVAL;
}
@ -883,7 +882,6 @@ static int translate_table(struct ebt_replace *repl,
EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
ebt_cleanup_entry, &i);
}
if (cl_s)
vfree(cl_s);
return ret;
}
@ -1030,7 +1028,6 @@ static int do_replace(void __user *user, unsigned int len)
}
vfree(table);
if (counterstmp)
vfree(counterstmp);
return ret;
@ -1040,7 +1037,6 @@ free_iterate:
EBT_ENTRY_ITERATE(newinfo->entries, newinfo->entries_size,
ebt_cleanup_entry, NULL);
free_counterstmp:
if (counterstmp)
vfree(counterstmp);
/* can be initialized in translate_table() */
if (newinfo->chainstack) {
@ -1049,10 +1045,8 @@ free_counterstmp:
vfree(newinfo->chainstack);
}
free_entries:
if (newinfo->entries)
vfree(newinfo->entries);
free_newinfo:
if (newinfo)
vfree(newinfo);
return ret;
}
@ -1213,7 +1207,6 @@ void ebt_unregister_table(struct ebt_table *table)
down(&ebt_mutex);
LIST_DELETE(&ebt_tables, table);
up(&ebt_mutex);
if (table->private->entries)
vfree(table->private->entries);
if (table->private->chainstack) {
for (i = 0; i < num_possible_cpus(); i++)