aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-10-21 12:20:12 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-21 15:08:10 -0400
commit5c6761adc77c131ef1601016f9ebbad0a9ae6d1a (patch)
tree3a5b2d61cc99ea0256f1fb754b6e6495dafa554f
parent9208247d74bc52dcaf370ba3cee29b5e8775464b (diff)
mac80211: remove unnecessary null test before debugfs_remove()
The debugfs_remove() function can safely take NULL parameters so the additionally null test isn't required, and there's no other reason to have it here, so remove it. Signed-off-by: Fabian Frederick <fabf@skynet.be> [rewrite commit message, re-introduce blank line after assert] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--net/mac80211/debugfs_key.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 1521cabad3d6..5523b94c7c90 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -300,10 +300,8 @@ void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata)
300 300
301 lockdep_assert_held(&sdata->local->key_mtx); 301 lockdep_assert_held(&sdata->local->key_mtx);
302 302
303 if (sdata->debugfs.default_unicast_key) { 303 debugfs_remove(sdata->debugfs.default_unicast_key);
304 debugfs_remove(sdata->debugfs.default_unicast_key); 304 sdata->debugfs.default_unicast_key = NULL;
305 sdata->debugfs.default_unicast_key = NULL;
306 }
307 305
308 if (sdata->default_unicast_key) { 306 if (sdata->default_unicast_key) {
309 key = key_mtx_dereference(sdata->local, 307 key = key_mtx_dereference(sdata->local,
@@ -314,10 +312,8 @@ void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata)
314 sdata->vif.debugfs_dir, buf); 312 sdata->vif.debugfs_dir, buf);
315 } 313 }
316 314
317 if (sdata->debugfs.default_multicast_key) { 315 debugfs_remove(sdata->debugfs.default_multicast_key);
318 debugfs_remove(sdata->debugfs.default_multicast_key); 316 sdata->debugfs.default_multicast_key = NULL;
319 sdata->debugfs.default_multicast_key = NULL;
320 }
321 317
322 if (sdata->default_multicast_key) { 318 if (sdata->default_multicast_key) {
323 key = key_mtx_dereference(sdata->local, 319 key = key_mtx_dereference(sdata->local,