Commit 82e46564 authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: remove unnecessary netdev validation check in del_key()

Removed unnecessary check to compare vif interface with zeroth index
element in vif array. Already the caller takes care of passing the
appropriate netdev handler during the del key operation.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20190926151436.27819-1-ajay.kathat@microchip.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 22824194
...@@ -620,11 +620,9 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -620,11 +620,9 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
bool pairwise, bool pairwise,
const u8 *mac_addr) const u8 *mac_addr)
{ {
struct wilc *wl = wiphy_priv(wiphy);
struct wilc_vif *vif = netdev_priv(netdev); struct wilc_vif *vif = netdev_priv(netdev);
struct wilc_priv *priv = &vif->priv; struct wilc_priv *priv = &vif->priv;
if (netdev == wl->vif[0]->ndev) {
if (priv->wilc_gtk[key_index]) { if (priv->wilc_gtk[key_index]) {
kfree(priv->wilc_gtk[key_index]->key); kfree(priv->wilc_gtk[key_index]->key);
priv->wilc_gtk[key_index]->key = NULL; priv->wilc_gtk[key_index]->key = NULL;
...@@ -643,7 +641,6 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -643,7 +641,6 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
kfree(priv->wilc_ptk[key_index]); kfree(priv->wilc_ptk[key_index]);
priv->wilc_ptk[key_index] = NULL; priv->wilc_ptk[key_index] = NULL;
} }
}
if (key_index <= 3 && priv->wep_key_len[key_index]) { if (key_index <= 3 && priv->wep_key_len[key_index]) {
memset(priv->wep_key[key_index], 0, memset(priv->wep_key[key_index], 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment