]> git.baikalelectronics.ru Git - kernel.git/commit
batman-adv: check batadv_orig_hash_add_if() return code
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
Sun, 1 Jul 2012 20:51:55 +0000 (22:51 +0200)
committerAntonio Quartulli <ordex@autistici.org>
Thu, 23 Aug 2012 12:02:46 +0000 (14:02 +0200)
commit9202d576d52fc6aa645ae948ecc1fade53ebbf9c
tree2ca06ceb55ad048e233fba6473f4c0244b034f62
parentb13f5cd7080a221c08055cda6e1448d2df9f807d
batman-adv: check batadv_orig_hash_add_if() return code

If this call fails, some of the orig_nodes spaces may have been
resized for the increased number of interface, and some may not.
If we would just continue with the larger number of interfaces,
this would lead to access to not allocated memory later.

We better check the return code, and don't add the interface if
no memory is available. OTOH, keeping some of the orig_nodes
with too much memory allocated should hurt no one (except for
a few too many bytes allocated).

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
net/batman-adv/hard-interface.c