From: Eyal Shapira Date: Sun, 5 Jan 2014 19:04:19 +0000 (+0200) Subject: iwlwifi: mvm: rs: fix a theoretical out of bounds access X-Git-Tag: v3.14-rc1~94^2~113^2^2~18^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=560843f4ab7ba8c2e5edf01949bba4d7a94f01e9;p=pandora-kernel.git iwlwifi: mvm: rs: fix a theoretical out of bounds access Discovered by klocwork Array 'iwl_rate_mcs' of size 15 may use index value(s) -1 * rs.c:2562: index = iwl_hwrate_to_plcp_idx(rate) * rs.c:2562: Result of function call 'iwl_hwrate_to_plcp_idx(rate)' is '[-1,14]' * rs.c:2565: Array 'iwl_rate_mcs' size is 15. * rs.c:2565: Possible attempt to access element -1 of array 'iwl_rate_mcs'. While at it stop using index = -1 and always use IWL_RATE_INVALID Signed-off-by: Eyal Shapira Signed-off-by: Emmanuel Grumbach --- Reading git-diff-tree failed