Skip to content

Commit

Permalink
mac80211: remove unnecessary null test before debugfs_remove()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabian Frederick authored and Johannes Berg committed Oct 21, 2014
1 parent 9208247 commit 5c6761a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions net/mac80211/debugfs_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,8 @@ void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata)

lockdep_assert_held(&sdata->local->key_mtx);

if (sdata->debugfs.default_unicast_key) {
debugfs_remove(sdata->debugfs.default_unicast_key);
sdata->debugfs.default_unicast_key = NULL;
}
debugfs_remove(sdata->debugfs.default_unicast_key);
sdata->debugfs.default_unicast_key = NULL;

if (sdata->default_unicast_key) {
key = key_mtx_dereference(sdata->local,
Expand All @@ -314,10 +312,8 @@ void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata)
sdata->vif.debugfs_dir, buf);
}

if (sdata->debugfs.default_multicast_key) {
debugfs_remove(sdata->debugfs.default_multicast_key);
sdata->debugfs.default_multicast_key = NULL;
}
debugfs_remove(sdata->debugfs.default_multicast_key);
sdata->debugfs.default_multicast_key = NULL;

if (sdata->default_multicast_key) {
key = key_mtx_dereference(sdata->local,
Expand Down

0 comments on commit 5c6761a

Please sign in to comment.