batman-adv: Split batadv_iv_ogm_orig_del_if function
authorSven Eckelmann <sven@narfation.org>
Mon, 22 Feb 2016 21:56:34 +0000 (22:56 +0100)
committerAntonio Quartulli <a@unstable.cc>
Tue, 3 May 2016 18:22:03 +0000 (02:22 +0800)
commit64ae74455371a40bc9f9c8325eb4c37f2978c95f
tree8c4fab8cd7408ab40597db1f80df9540b8d528dd
parent86de37c1fb16d71402773a3da05abe6cc7346f94
batman-adv: Split batadv_iv_ogm_orig_del_if function

batadv_iv_ogm_orig_del_if handles two different buffers bcast_own and
bcast_own_sum which should be resized. The error handling two for
allocating these buffers causes the complexity of this function. This can
be avoided completely when the function is split into a main function
handling the locking, freeing and call of the subfunctions.

The subfunction can then independently handle the resize of the buffers.
This also allows to easily reuse the old buffer (which always is larger) in
case a smaller buffer could not be allocated without increasing the code
complexity.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <a@unstable.cc>
net/batman-adv/bat_iv_ogm.c