diff options
| author | Martin Kaiser <martin@kaiser.cx> | 2022-02-12 17:17:29 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-15 17:11:22 +0100 |
| commit | e31e782a361af7cda6169220b4e9a4ae814eecfe (patch) | |
| tree | deba9e3ef7f087fe83edc48b1872d56596af4cf4 | |
| parent | d709b5ae9a44f00a5feb010fc215be9dcf472e64 (diff) | |
| download | linux-e31e782a361af7cda6169220b4e9a4ae814eecfe.tar.gz linux-e31e782a361af7cda6169220b4e9a4ae814eecfe.zip | |
staging: r8188eu: write only path a registers in rtw_dbg_port
Commit 3b011b097c38 ("staging: r8188eu: limit rf register writes to
path a") limited the rtw_wx_write_rf function to write only rf registers
for path a.
The private ioctl 0x0B invokes the rtw_dbg_port function. This ioctl
can also be used for writing rf registers. We should limit these register
writes to rf path a as well.
Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20220212161737.381841-3-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/r8188eu/os_dep/ioctl_linux.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c index 8c49df724461..9d3488c28048 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -3621,7 +3621,11 @@ static int rtw_dbg_port(struct net_device *dev, DBG_88E("read RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtl8188e_PHY_QueryRFReg(padapter, minor_cmd, arg, 0xffffffff)); break; case 0x75:/* write_rf */ - rtl8188e_PHY_SetRFReg(padapter, minor_cmd, arg, 0xffffffff, extra_arg); + if (minor_cmd != RF_PATH_A) { + ret = -EINVAL; + break; + } + rtl8188e_PHY_SetRFReg(padapter, RF_PATH_A, arg, 0xffffffff, extra_arg); DBG_88E("write RF_reg path(0x%02x), offset(0x%x), value(0x%08x)\n", minor_cmd, arg, rtl8188e_PHY_QueryRFReg(padapter, minor_cmd, arg, 0xffffffff)); break; |
