From: Diego Escalante Urrelo Date: Tue, 28 Jul 2020 13:59:56 -0500 Subject: wl: Avoid disconnecting invalid interface Mimic brcmfmac driver and don't try to call WLC_DISASSOC on an invalid interface. --- amd64/src/wl/sys/wl_cfg80211_hybrid.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/amd64/src/wl/sys/wl_cfg80211_hybrid.c b/amd64/src/wl/sys/wl_cfg80211_hybrid.c index 195c0e4..1801f70 100644 --- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c +++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c @@ -1065,14 +1065,15 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev, u16 reason_c WL_DBG(("Reason %d\n", reason_code)); if (wl->profile->active) { - scbval.val = reason_code; memcpy(&scbval.ea, &wl->bssid, ETHER_ADDR_LEN); - scbval.val = htod32(scbval.val); - err = wl_dev_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scb_val_t)); + scbval.val = htod32(reason_code); + err = wl_dev_ioctl(dev, WLC_DISASSOC, &scbval, sizeof(scbval)); if (err) { WL_ERR(("error (%d)\n", err)); return err; } + } else { + return -EIO; } return err;