[1/2] alfred: Only query debugfs when netlink failed

Message ID 20171009153307.29245-1-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit b5e24fc510502c7698d9740aa319b08bc2ffc2b2
Delegated to: Simon Wunderlich
Headers
Series [1/2] alfred: Only query debugfs when netlink failed |

Commit Message

Sven Eckelmann Oct. 9, 2017, 3:33 p.m. UTC
  It is enough to just request the data from netlink and skip debugfs when
netlink didn't return an error. The overwrite of the ret variable was only
for testing purposes and should no longer be used.

Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 batadv_query.c | 2 --
 1 file changed, 2 deletions(-)
  

Comments

Simon Wunderlich Oct. 23, 2017, 3:27 p.m. UTC | #1
On Monday, October 9, 2017 5:33:06 PM CEST Sven Eckelmann wrote:
> It is enough to just request the data from netlink and skip debugfs when
> netlink didn't return an error. The overwrite of the ret variable was only
> for testing purposes and should no longer be used.
> 
> Fixes: a7bc3d9a2b3f ("alfred: Cache the global translation table entries")
> Signed-off-by: Sven Eckelmann <sven@narfation.org>

I've applied this series (b5e24fc, 6084780).

Thank you!
     Simon
  

Patch

diff --git a/batadv_query.c b/batadv_query.c
index 8580f1b..78b92cd 100644
--- a/batadv_query.c
+++ b/batadv_query.c
@@ -308,7 +308,6 @@  struct hashtable_t *tg_hash_new(const char *mesh_iface)
 	ret = translate_mac_netlink(mesh_iface, tg_hash);
 	enable_net_admin_capability(0);
 
-	ret = -EOPNOTSUPP;
 	if (ret == -EOPNOTSUPP)
 		translate_mac_debugfs(mesh_iface, tg_hash);
 
@@ -477,7 +476,6 @@  struct hashtable_t *orig_hash_new(const char *mesh_iface)
 	ret = get_tq_netlink(mesh_iface, orig_hash);
 	enable_net_admin_capability(0);
 
-	ret = -EOPNOTSUPP;
 	if (ret == -EOPNOTSUPP)
 		get_tq_debugfs(mesh_iface, orig_hash);