]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: mt76: mt7915: fix possible integer overflows in mt7915_muru_stats_show()
authorNikita Zhandarovich <n.zhandarovich@fintech.ru>
Tue, 14 Jan 2025 15:44:41 +0000 (07:44 -0800)
committerFelix Fietkau <nbd@nbd.name>
Wed, 19 Mar 2025 13:47:02 +0000 (14:47 +0100)
commit77b749520cac06d000d9923f79ffa632cdea6113
treea532fc49e576f0f51f345a286958087da65cb695
parent2d5630b0c9466ac6549495828aa7dce7424a272a
wifi: mt76: mt7915: fix possible integer overflows in mt7915_muru_stats_show()

Assuming sums of values stored in variables such as sub_total_cnt
and total_ppdu_cnt are big enough to warrant their u64 type, it
makes sense to ensure that their calculation takes into account
possible integer overflow issues.

Play it safe and fix the problem by casting right hand expressions
to u64 as well. Also, slightly adjust tabulation.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 1966a5078f2d ("mt76: mt7915: add mu-mimo and ofdma debugfs knobs")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Link: https://patch.msgid.link/20250114154441.16920-1-n.zhandarovich@fintech.ru
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c