mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
wifi: rtw89: debug: avoid invalid access on RTW89_DBG_SEL_MAC_30
[ Upstream commit c074da21dd ]
Only 8852C chip has valid pages on RTW89_DBG_SEL_MAC_30. To other chips,
this section is an address hole. It will lead to crash if trying to access
this section on chips except for 8852C. So, we avoid that.
Signed-off-by: Zong-Zhe Yang <kevin_yang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230119063529.61563-2-pkshih@realtek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7dbb8ceea1
commit
20a89a4442
@@ -594,6 +594,7 @@ rtw89_debug_priv_mac_reg_dump_select(struct file *filp,
|
||||
struct seq_file *m = (struct seq_file *)filp->private_data;
|
||||
struct rtw89_debugfs_priv *debugfs_priv = m->private;
|
||||
struct rtw89_dev *rtwdev = debugfs_priv->rtwdev;
|
||||
const struct rtw89_chip_info *chip = rtwdev->chip;
|
||||
char buf[32];
|
||||
size_t buf_size;
|
||||
int sel;
|
||||
@@ -613,6 +614,12 @@ rtw89_debug_priv_mac_reg_dump_select(struct file *filp,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (sel == RTW89_DBG_SEL_MAC_30 && chip->chip_id != RTL8852C) {
|
||||
rtw89_info(rtwdev, "sel %d is address hole on chip %d\n", sel,
|
||||
chip->chip_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
debugfs_priv->cb_data = sel;
|
||||
rtw89_info(rtwdev, "select mac page dump %d\n", debugfs_priv->cb_data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user