mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
net: wireless: rockchip_wlan: realtek wifi: avoid illegal argument when called by ioctl SIOCDEVPRIVATE
Illegal argument will cause following kernel panic. Call trace: PHY_SetRFReg_8723B rtw_hal_write_rfreg rtw_wx_write_rf _rtw_ioctl_wext_private rtw_ioctl dev_ifsioc dev_ioctl References: CNVD-C-2020-259508 Signed-off-by: Weiguo Hu <hwg@rock-chips.com> Change-Id: Ia493d8276c1dd414c184a9b3eddb5d252bd85b98
This commit is contained in:
parent
21f2c43755
commit
103827124a
|
|
@ -571,6 +571,9 @@ phy_RFSerialWrite(
|
|||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
#if 0
|
||||
/* <Roger_TODO> We should check valid regs for RF_6052 case. */
|
||||
if (pHalData->RFChipID == RF_8225 && Offset > 0x24) /* 36 valid regs */
|
||||
|
|
|
|||
|
|
@ -339,6 +339,9 @@ phy_RFSerialWrite_8188F(
|
|||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
Offset &= 0xff;
|
||||
|
||||
/* */
|
||||
|
|
|
|||
|
|
@ -581,6 +581,9 @@ phy_RFSerialWrite(
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
#if 0
|
||||
//<Roger_TODO> We should check valid regs for RF_6052 case.
|
||||
|
|
|
|||
|
|
@ -277,6 +277,9 @@ phy_RFSerialWrite_8188F(
|
|||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
Offset &= 0xff;
|
||||
|
||||
/* */
|
||||
|
|
|
|||
|
|
@ -333,6 +333,9 @@ phy_RFSerialWrite_8723B(
|
|||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
Offset &= 0xff;
|
||||
|
||||
/* */
|
||||
|
|
|
|||
|
|
@ -344,6 +344,10 @@ phy_RFSerialWrite_8723B(
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
|
||||
Offset &= 0xff;
|
||||
|
||||
|
|
|
|||
|
|
@ -277,6 +277,9 @@ phy_RFSerialWrite_8703B(
|
|||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
Offset &= 0xff;
|
||||
|
||||
/* */
|
||||
|
|
|
|||
|
|
@ -278,6 +278,9 @@ phy_RFSerialWrite_8723D(
|
|||
BB_REGISTER_DEFINITION_T *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
if (eRFPath >= MAX_RF_PATH)
|
||||
return;
|
||||
|
||||
Offset &= 0xff;
|
||||
|
||||
/* */
|
||||
|
|
@ -1191,4 +1194,4 @@ PHY_SetSwChnlBWMode8723D(
|
|||
|
||||
/* RTW_INFO("<==%s()\n",__FUNCTION__); */
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user