Skip to content

Commit 42afe7d

Browse files
committed
Merge tag 'staging-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver fixes from Greg KH: "Here are a small number of tiny staging driver fixes for 5.8-rc3. Not much here, but there were some reported problems to be fixed: - three wfx driver fixes - rtl8723bs driver fix All of these have been in linux-next with no reported issues" * tag 'staging-5.8-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: Staging: rtl8723bs: prevent buffer overflow in update_sta_support_rate() staging: wfx: fix coherency of hif_scan() prototype staging: wfx: drop useless loop staging: wfx: fix AC priority
2 parents 7eb8f53 + b65a2d8 commit 42afe7d

File tree

5 files changed

+20
-19
lines changed

5 files changed

+20
-19
lines changed

drivers/staging/rtl8723bs/core/rtw_wlan_util.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1824,12 +1824,14 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
18241824
pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, _SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
18251825
if (!pIE)
18261826
return _FAIL;
1827+
if (ie_len > sizeof(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates))
1828+
return _FAIL;
18271829

18281830
memcpy(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates, pIE->data, ie_len);
18291831
supportRateNum = ie_len;
18301832

18311833
pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, _EXT_SUPPORTEDRATES_IE_, &ie_len, var_ie_len);
1832-
if (pIE)
1834+
if (pIE && (ie_len <= sizeof(pmlmeinfo->FW_sta_info[cam_idx].SupportedRates) - supportRateNum))
18331835
memcpy((pmlmeinfo->FW_sta_info[cam_idx].SupportedRates + supportRateNum), pIE->data, ie_len);
18341836

18351837
return _SUCCESS;

drivers/staging/wfx/hif_tx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
240240
}
241241

242242
int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
243-
int chan_start_idx, int chan_num)
243+
int chan_start_idx, int chan_num, int *timeout)
244244
{
245245
int ret, i;
246246
struct hif_msg *hif;
@@ -289,11 +289,13 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
289289
tmo_chan_fg = 512 * USEC_PER_TU + body->probe_delay;
290290
tmo_chan_fg *= body->num_of_probe_requests;
291291
tmo = chan_num * max(tmo_chan_bg, tmo_chan_fg) + 512 * USEC_PER_TU;
292+
if (timeout)
293+
*timeout = usecs_to_jiffies(tmo);
292294

293295
wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START_SCAN, buf_len);
294296
ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false);
295297
kfree(hif);
296-
return ret ? ret : usecs_to_jiffies(tmo);
298+
return ret;
297299
}
298300

299301
int hif_stop_scan(struct wfx_vif *wvif)

drivers/staging/wfx/hif_tx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
4242
int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
4343
void *buf, size_t buf_size);
4444
int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211,
45-
int chan_start, int chan_num);
45+
int chan_start, int chan_num, int *timeout);
4646
int hif_stop_scan(struct wfx_vif *wvif);
4747
int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
4848
struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);

drivers/staging/wfx/queue.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
246246
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
247247
sorted_queues[i] = &wdev->tx_queue[i];
248248
for (j = i; j > 0; j--)
249-
if (atomic_read(&sorted_queues[j]->pending_frames) >
249+
if (atomic_read(&sorted_queues[j]->pending_frames) <
250250
atomic_read(&sorted_queues[j - 1]->pending_frames))
251251
swap(sorted_queues[j - 1], sorted_queues[j]);
252252
}
@@ -291,15 +291,12 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
291291

292292
if (atomic_read(&wdev->tx_lock))
293293
return NULL;
294-
295-
for (;;) {
296-
skb = wfx_tx_queues_get_skb(wdev);
297-
if (!skb)
298-
return NULL;
299-
skb_queue_tail(&wdev->tx_pending, skb);
300-
wake_up(&wdev->tx_dequeue);
301-
tx_priv = wfx_skb_tx_priv(skb);
302-
tx_priv->xmit_timestamp = ktime_get();
303-
return (struct hif_msg *)skb->data;
304-
}
294+
skb = wfx_tx_queues_get_skb(wdev);
295+
if (!skb)
296+
return NULL;
297+
skb_queue_tail(&wdev->tx_pending, skb);
298+
wake_up(&wdev->tx_dequeue);
299+
tx_priv = wfx_skb_tx_priv(skb);
300+
tx_priv->xmit_timestamp = ktime_get();
301+
return (struct hif_msg *)skb->data;
305302
}

drivers/staging/wfx/scan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ static int send_scan_req(struct wfx_vif *wvif,
5656
wfx_tx_lock_flush(wvif->wdev);
5757
wvif->scan_abort = false;
5858
reinit_completion(&wvif->scan_complete);
59-
timeout = hif_scan(wvif, req, start_idx, i - start_idx);
60-
if (timeout < 0) {
59+
ret = hif_scan(wvif, req, start_idx, i - start_idx, &timeout);
60+
if (ret) {
6161
wfx_tx_unlock(wvif->wdev);
62-
return timeout;
62+
return -EIO;
6363
}
6464
ret = wait_for_completion_timeout(&wvif->scan_complete, timeout);
6565
if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower)

0 commit comments

Comments
 (0)