Skip to content

Commit

Permalink
mac80211-hwsim: remove unnecessary hwname check
Browse files Browse the repository at this point in the history
The hwname will always be set if idx is negative (as it's
a u32 read into an s64 it can't overflow either) so we can
remove the unnecessary check for hwname being non-NULL.

This was reported by smatch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Johannes Berg committed Nov 19, 2014
1 parent b9995f8 commit 6b67e01
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -2808,8 +2808,7 @@ static int hwsim_del_radio_nl(struct sk_buff *msg, struct genl_info *info)
if (data->idx != idx)
continue;
} else {
if (hwname &&
strcmp(hwname, wiphy_name(data->hw->wiphy)))
if (strcmp(hwname, wiphy_name(data->hw->wiphy)))
continue;
}

Expand Down

0 comments on commit 6b67e01

Please sign in to comment.