diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2019-10-11 10:16:41 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-14 15:37:18 +0200 |
commit | 44288f1101feba11beef9536b176dadae420d874 (patch) | |
tree | 4c36db78d6abce0515db51df846fa183a4c7724c /drivers/staging/wfx | |
parent | 807411911d99fe13ade4c02db4606f2df672f589 (diff) | |
download | linux-44288f1101feba11beef9536b176dadae420d874.tar.gz linux-44288f1101feba11beef9536b176dadae420d874.tar.bz2 linux-44288f1101feba11beef9536b176dadae420d874.zip |
staging: wfx: fix error handling in wfx_tx_get_raw_link_id()
Since wfx_tx_get_raw_link_id() return an unsigned, it makes no sense to
return a negative value. "15" is a better value since it is used by
firmware for stations that have not yet associated link-ids.
Note that this should never happens since driver set max_ap_assoc_sta
to 14.
Fixes: 9bca45f3d692 ("staging: wfx: allow to send 802.11 frames")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20191011101639.31025-1-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx')
-rw-r--r-- | drivers/staging/wfx/data_tx.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 6e4dd4ac5544..8ed38cac19f6 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -17,6 +17,7 @@ #include "hif_tx_mib.h" #define WFX_INVALID_RATE_ID (0xFF) +#define WFX_LINK_ID_NO_ASSOC 15 #define WFX_LINK_ID_GC_TIMEOUT ((unsigned long)(10 * HZ)) static int wfx_get_hw_rate(struct wfx_dev *wdev, const struct ieee80211_tx_rate *rate) @@ -480,7 +481,7 @@ static uint8_t wfx_tx_get_raw_link_id(struct wfx_vif *wvif, struct ieee80211_sta ret = wfx_alloc_link_id(wvif, da); if (!ret) { dev_err(wvif->wdev->dev, "no more link-id available\n"); - return -ENOENT; + return WFX_LINK_ID_NO_ASSOC; } return ret; } |