diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2021-09-13 15:01:43 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-14 09:16:32 +0200 |
commit | 2ac7521bf99ce118c66e359bde5d40fea2730f15 (patch) | |
tree | 8000a09827c2a87e6b6adcd9ed004e4548ecb17d /drivers/staging/wfx | |
parent | 08127ad2a79b74576a139d6fcb8d40b4f0105461 (diff) | |
download | linux-2ac7521bf99ce118c66e359bde5d40fea2730f15.tar.bz2 |
staging: wfx: simplify API coherency check
The 'channel' argument of hif_join() should never be NULL. hif_join()
does not have the responsibility to recover bug of caller.
In current code, if the argument channel is NULL, memory leaks. The new
code just emit a warning and does not give the illusion that it is
supported (and indeed a Oops will probably raise a few lines below).
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20210913130203.1903622-13-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/hif_tx.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c index 14b7e047916e..fcce78bb3005 100644 --- a/drivers/staging/wfx/hif_tx.c +++ b/drivers/staging/wfx/hif_tx.c @@ -301,8 +301,6 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf, WARN_ON(!conf->basic_rates); WARN_ON(sizeof(body->ssid) < ssidlen); WARN(!conf->ibss_joined && !ssidlen, "joining an unknown BSS"); - if (WARN_ON(!channel)) - return -EINVAL; if (!hif) return -ENOMEM; body->infrastructure_bss_mode = !conf->ibss_joined; |