mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-25 11:55:37 +00:00
wilc1000: add 'initialized' flag check before adding an element to TX queue
Add 'initialized' variable check before adding net/mgmt packet to TX queue as safety check before passing the commands to the firmware. Signed-off-by: Ajay Singh <ajay.kathat@microchip.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/20210916164902.74629-10-ajay.kathat@microchip.com
This commit is contained in:
parent
29f7393e02
commit
cd50248de3
2 changed files with 13 additions and 0 deletions
|
@ -728,6 +728,7 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||
{
|
||||
struct wilc_vif *vif = netdev_priv(dev);
|
||||
struct wilc_priv *priv = &vif->priv;
|
||||
struct wilc *wilc = vif->wilc;
|
||||
u32 i = 0;
|
||||
u32 associatedsta = ~0;
|
||||
u32 inactive_time = 0;
|
||||
|
@ -754,6 +755,9 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
|
|||
} else if (vif->iftype == WILC_STATION_MODE) {
|
||||
struct rf_info stats;
|
||||
|
||||
if (!wilc->initialized)
|
||||
return -EBUSY;
|
||||
|
||||
wilc_get_statistics(vif, &stats);
|
||||
|
||||
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_SIGNAL) |
|
||||
|
|
|
@ -427,6 +427,11 @@ int wilc_wlan_txq_add_net_pkt(struct net_device *dev,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!wilc->initialized) {
|
||||
tx_complete_fn(tx_data, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC);
|
||||
|
||||
if (!tqe) {
|
||||
|
@ -476,6 +481,10 @@ int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!wilc->initialized) {
|
||||
tx_complete_fn(priv, 0);
|
||||
return 0;
|
||||
}
|
||||
tqe = kmalloc(sizeof(*tqe), GFP_ATOMIC);
|
||||
|
||||
if (!tqe) {
|
||||
|
|
Loading…
Reference in a new issue