mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 18:19:28 +09:00
staging: rtl8822be: Keep array subscript no lower than zero
[ Upstream commit43d15c2013] The kbuild test robot reports the following: drivers/staging//rtlwifi/phydm/phydm_dig.c: In function 'odm_pause_dig': drivers/staging//rtlwifi/phydm/phydm_dig.c:494:45: warning: array subscript is below array bounds [-Warray-bounds] odm_write_dig(dm, dig_tab->pause_dig_value[max_level]); This condition is caused when a loop falls through. The fix is to pin max_level to be >= 0. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> c: kbuild test robot <fengguang.wu@intel.com> Fixes:9ce99b04b5staging: r8822be: Add phydm mini driver Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
11d9a37aaf
commit
2001a980d1
@@ -490,6 +490,8 @@ void odm_pause_dig(void *dm_void, enum phydm_pause_type pause_type,
|
||||
break;
|
||||
}
|
||||
|
||||
/* pin max_level to be >= 0 */
|
||||
max_level = max_t(s8, 0, max_level);
|
||||
/* write IGI of lower level */
|
||||
odm_write_dig(dm, dig_tab->pause_dig_value[max_level]);
|
||||
ODM_RT_TRACE(dm, ODM_COMP_DIG,
|
||||
|
||||
Reference in New Issue
Block a user