mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-13 07:31:07 +00:00
batman-adv: tt: extract allocation of new local entries
The code which allocates and initializes a brand new local TT entry makes up more than a third of batadv_tt_local_add(). It only shares the addr, vid and iif_is_wifi parameters with the rest of the function. Move it to batadv_tt_local_create(), which returns the fully initialized entry. The error paths become plain returns. The insertion into bat_priv->tt.local_hash intentionally stays in batadv_tt_local_add(), keeping the extra reference for the hash next to the error handling which has to drop it again. Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
parent
3273a5cd2d
commit
defa87f5ce
1 changed files with 79 additions and 56 deletions
Loading…
Add table
Add a link
Reference in a new issue