diff options
author | Sven Eckelmann <sven@narfation.org> | 2012-05-05 07:27:28 -0400 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-06-18 12:01:03 -0400 |
commit | 5346c35ebfbdb1727e60079456dd8071cb888059 (patch) | |
tree | 90bba36cd5e27b1a248cf78d4a4859b6d7275092 /net/batman-adv/bat_debugfs.c | |
parent | e0f5211f9bbfaa66d27cda6b0dc86466c7dcb206 (diff) |
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.c | 11 |
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) | |||
195 | 195 | ||
196 | d = debugfs_create_file("log", S_IFREG | S_IRUSR, | 196 | d = debugfs_create_file("log", S_IFREG | S_IRUSR, |
197 | bat_priv->debug_dir, bat_priv, &log_fops); | 197 | bat_priv->debug_dir, bat_priv, &log_fops); |
198 | if (d) | 198 | if (!d) |
199 | goto err; | 199 | goto err; |
200 | 200 | ||
201 | return 0; | 201 | return 0; |
202 | 202 | ||
203 | err: | 203 | err: |
204 | return 1; | 204 | return -ENOMEM; |
205 | } | 205 | } |
206 | 206 | ||
207 | static void debug_log_cleanup(struct bat_priv *bat_priv) | 207 | static void debug_log_cleanup(struct bat_priv *bat_priv) |
@@ -348,8 +348,11 @@ int debugfs_add_meshif(struct net_device *dev) | |||
348 | if (!bat_priv->debug_dir) | 348 | if (!bat_priv->debug_dir) |
349 | goto out; | 349 | goto out; |
350 | 350 | ||
351 | bat_socket_setup(bat_priv); | 351 | if (bat_socket_setup(bat_priv) < 0) |
352 | debug_log_setup(bat_priv); | 352 | goto rem_attr; |
353 | |||
354 | if (debug_log_setup(bat_priv) < 0) | ||
355 | goto rem_attr; | ||
353 | 356 | ||
354 | for (bat_debug = mesh_debuginfos; *bat_debug; ++bat_debug) { | 357 | for (bat_debug = mesh_debuginfos; *bat_debug; ++bat_debug) { |
355 | file = debugfs_create_file(((*bat_debug)->attr).name, | 358 | file = debugfs_create_file(((*bat_debug)->attr).name, |