Skip to content

Commit

Permalink
wifi: mt76: mt7996: fix integer handling issue of mt7996_rf_regval_set()
Browse files Browse the repository at this point in the history
This code is supposed to set a u32 value, but casting will not work on
big endian systems.

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527816 ("Integer handling issues")
Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
ryderlee1110 authored and nbd168 committed Dec 10, 2022
1 parent 233c272 commit 5616c4c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mt7996/debugfs.c
Expand Up @@ -653,8 +653,9 @@ static int
mt7996_rf_regval_set(void *data, u64 val)
{
struct mt7996_dev *dev = data;
u32 val32 = val;

return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, (u32 *)&val, true);
return mt7996_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &val32, true);
}

DEFINE_DEBUGFS_ATTRIBUTE(fops_rf_regval, mt7996_rf_regval_get,
Expand Down

0 comments on commit 5616c4c

Please sign in to comment.