# \[PATCH 04/13\] batman-adv: Remove vis info on hashing errors

- Subsystems: BATMAN ADVANCED, THE REST
- Maintainers: Marek Lindner, Simon Wunderlich, Antonio Quartulli, Sven Eckelmann, Linus Torvalds
- List: netdev
- 1 message, 1 author
- Page: https://ratatoskr.run/netdev/2011/01/10863232/t

## \[PATCH 04/13\] batman-adv: Remove vis info on hashing errors

- From: Sven Eckelmann \<hidden\>
- Date: 2011-01-29 21:47:31 
- Message: https://ratatoskr.run/netdev/2011/01/10863232.md

```text
A newly created vis info object must be removed when it couldn't be
added to the hash. The old_info which has to be replaced was already
removed and isn't related to the hash anymore.

Signed-off-by: Sven Eckelmann <redacted>
---
 net/batman-adv/vis.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index f69a374..0be55be 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -444,7 +444,7 @@ static struct vis_info *add_packet(struct bat_priv *bat_priv,
 			      info);
 	if (hash_added < 0) {
 		/* did not work (for some reason) */
-		kref_put(&old_info->refcount, free_info);
+		kref_put(&info->refcount, free_info);
 		info = NULL;
 	}
 
-- 
1.7.2.3
```
