diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2022-05-19 15:57:22 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2022-07-11 13:40:00 +0200 |
commit | f572dc969a59a80baa22bf2f7c9af0064402652f (patch) | |
tree | 9e93affb942eeab7ae2585a72a525e158b13b674 /drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c | |
parent | mt76: mt76x02u: fix possible memory leak in __mt76x02u_mcu_send_msg (diff) | |
download | linux-f572dc969a59a80baa22bf2f7c9af0064402652f.tar.xz linux-f572dc969a59a80baa22bf2f7c9af0064402652f.zip |
mt76: mt7915: fix endian bug in mt7915_rf_regval_set()
This code is supposed to set a u32 value, but casting will not work on
big endian systems.
Fixes: 0a17329ae9c1 ("mt76: mt7915: add debugfs knob for RF registers read/write")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c index d0c719ecacd0..fd76db8f5269 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c @@ -985,8 +985,9 @@ static int mt7915_rf_regval_set(void *data, u64 val) { struct mt7915_dev *dev = data; + u32 val32 = val; - return mt7915_mcu_rf_regval(dev, dev->mt76.debugfs_reg, (u32 *)&val, true); + return mt7915_mcu_rf_regval(dev, dev->mt76.debugfs_reg, &val32, true); } DEFINE_DEBUGFS_ATTRIBUTE(fops_rf_regval, mt7915_rf_regval_get, |