* we hit a failure path bug related to
    ieee80211_txq_setup_flows()
  * also use kvmalloc() to make that less likely
  * fix a timing value shortly after boot (during
    INITIAL_JIFFIES)
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEH1e1rEeCd0AIMq6MB8qZga/fl8QFAl3FYVEACgkQB8qZga/f
 l8RNHg//bVYynSBqMYDx+zjIG6fdlrI/zMAJIO9mjQmwNgUw67dSeO6fXhji9ngS
 jAhXaeJAj9qB++SxDncsOo4pWi+1IhuU1Zr+88WqpQvR78FT/5g0Jn5pNDkIOAT+
 w9w+RmK5iGmiyqyubKi/FGCX8F5WBVJWWIso4cctTWIAGGIOkNc47ZjfmoGZmxK3
 z9LhU98lGP1ZYXCOTx9kXOo4yf9GbC2vAC/JKmWc9jg1moDqbno/WNcc8TgDl9Z8
 935VzaZ1lt/2cWrCpjg8pJqPK4TMAIXdzYoUP1KixMjAI7wQVaUfiuIbOY+uXUmq
 zUzalSWuOBsaK2pKGfD7KbSekozc61A9APRhU5Onlco9mfVVqtfqsZiczCGgJk+I
 9e0uhYKlABSdkhNor6hcuF1s+lzxFT6ikB7rKUYns2w2EYLDwIWeOjUMPGRIhDGa
 86KwQQvMNxeyArMnsO4lI1W6vpSGO2BZ6H5SR6JsJN4B1Wb9UGslrMwTlbkUqqZz
 FEaT+8sKM3oqxadBOWCCynIPayiCaNSWxvN1aiV2nM1gyjXLzv+HFBhUpJUzMYpI
 jq1tI/410Ba2T9feieo/+7ekIQAMvqU10Kilol63n5osGAupl4Y8jPA7dSbkF3+F
 PZFvIgdv584UXnMVIysuBYm/oFoilpE4L51XxBPeRaJcl8gK8Wo=
 =jkY+
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-for-net-2019-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
Three small fixes:
 * we hit a failure path bug related to
   ieee80211_txq_setup_flows()
 * also use kvmalloc() to make that less likely
 * fix a timing value shortly after boot (during
   INITIAL_JIFFIES)
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller 2019-11-08 11:37:24 -08:00
Родитель e4dd560803 285531f9e6
Коммит b05f5b4a9b
3 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -313,7 +313,7 @@ static int fq_init(struct fq *fq, int flows_cnt)
fq->limit = 8192;
fq->memory_limit = 16 << 20; /* 16 MBytes */
fq->flows = kcalloc(fq->flows_cnt, sizeof(fq->flows[0]), GFP_KERNEL);
fq->flows = kvcalloc(fq->flows_cnt, sizeof(fq->flows[0]), GFP_KERNEL);
if (!fq->flows)
return -ENOMEM;
@ -331,7 +331,7 @@ static void fq_reset(struct fq *fq,
for (i = 0; i < fq->flows_cnt; i++)
fq_flow_reset(fq, &fq->flows[i], free_func);
kfree(fq->flows);
kvfree(fq->flows);
fq->flows = NULL;
}

Просмотреть файл

@ -1292,8 +1292,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
ieee80211_remove_interfaces(local);
fail_rate:
rtnl_unlock();
ieee80211_led_exit(local);
fail_flows:
ieee80211_led_exit(local);
destroy_workqueue(local->workqueue);
fail_workqueue:
wiphy_unregister(local->hw.wiphy);

Просмотреть файл

@ -2457,7 +2457,8 @@ unsigned long ieee80211_sta_last_active(struct sta_info *sta)
{
struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta);
if (time_after(stats->last_rx, sta->status_stats.last_ack))
if (!sta->status_stats.last_ack ||
time_after(stats->last_rx, sta->status_stats.last_ack))
return stats->last_rx;
return sta->status_stats.last_ack;
}