Skip to content

Commit

Permalink
mt76: mt7663s: fix a possible ple quota underflow
Browse files Browse the repository at this point in the history
[ Upstream commit 1c79a19 ]

Properly account current consumed ple quota in mt7663s_tx_pick_quota
routine and avoid possible underflow.

Fixes: 6ef2d66 ("mt76: mt7663s: split mt7663s_tx_update_sched in mt7663s_tx_{pick,update}_quota")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
LorenzoBianconi authored and gregkh committed Dec 30, 2020
1 parent a316447 commit 28f41cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c
Expand Up @@ -150,7 +150,7 @@ static int mt7663s_tx_pick_quota(struct mt76_sdio *sdio, enum mt76_txq_id qid,
return -EBUSY;
} else {
if (sdio->sched.pse_data_quota < *pse_size + pse_sz ||
sdio->sched.ple_data_quota < *ple_size)
sdio->sched.ple_data_quota < *ple_size + 1)
return -EBUSY;

*ple_size = *ple_size + 1;
Expand Down

0 comments on commit 28f41cc

Please sign in to comment.