summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_debugfs.c
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2012-05-05 13:27:28 +0200
committerAntonio Quartulli <ordex@autistici.org>2012-06-18 18:01:03 +0200
commit5346c35ebfbdb1727e60079456dd8071cb888059 (patch)
tree90bba36cd5e27b1a248cf78d4a4859b6d7275092 /net/batman-adv/bat_debugfs.c
parentbatman-adv: keep batman_ogm_packet ->seqno net-endian all along (diff)
downloadlinux-5346c35ebfbdb1727e60079456dd8071cb888059.tar.xz
linux-5346c35ebfbdb1727e60079456dd8071cb888059.zip
batman-adv: Return error codes instead of -1 on failures
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'net/batman-adv/bat_debugfs.c')
-rw-r--r--net/batman-adv/bat_debugfs.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/batman-adv/bat_debugfs.c b/net/batman-adv/bat_debugfs.c
index 3b588f86d770..db8273c26989 100644
--- a/net/batman-adv/bat_debugfs.c
+++ b/net/batman-adv/bat_debugfs.c
@@ -195,13 +195,13 @@ static int debug_log_setup(struct bat_priv *bat_priv)
d = debugfs_create_file("log", S_IFREG | S_IRUSR,
bat_priv->debug_dir, bat_priv, &log_fops);
- if (d)
+ if (!d)
goto err;
return 0;
err:
- return 1;
+ return -ENOMEM;
}
static void debug_log_cleanup(struct bat_priv *bat_priv)
@@ -348,8 +348,11 @@ int debugfs_add_meshif(struct net_device *dev)
if (!bat_priv->debug_dir)
goto out;
- bat_socket_setup(bat_priv);
- debug_log_setup(bat_priv);
+ if (bat_socket_setup(bat_priv) < 0)
+ goto rem_attr;
+
+ if (debug_log_setup(bat_priv) < 0)
+ goto rem_attr;
for (bat_debug = mesh_debuginfos; *bat_debug; ++bat_debug) {
file = debugfs_create_file(((*bat_debug)->attr).name,