提交 32c93a70 编写于 作者: J Johannes Berg 提交者: Emmanuel Grumbach

iwlwifi: correctly size command string arrays

The command string array is assumed to be indexable by a full u8, so it
must have 256 entries (0-255), not just 255. A recent firmware change
(apparently) started using the command 0xff for a notification to the
host, causing the driver to crash in debug message/tracing code.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
上级 ba537f98
......@@ -473,7 +473,7 @@ do { \
} while (0)
#endif /* CONFIG_IWLWIFI_DEBUG */
extern const char *const iwl_dvm_cmd_strings[REPLY_MAX];
extern const char *const iwl_dvm_cmd_strings[REPLY_MAX + 1];
static inline const char *iwl_dvm_get_cmd_string(u8 cmd)
{
......
......@@ -39,7 +39,7 @@
#define IWL_CMD_ENTRY(x) [x] = #x
const char *const iwl_dvm_cmd_strings[REPLY_MAX] = {
const char *const iwl_dvm_cmd_strings[REPLY_MAX + 1] = {
IWL_CMD_ENTRY(REPLY_ALIVE),
IWL_CMD_ENTRY(REPLY_ERROR),
IWL_CMD_ENTRY(REPLY_ECHO),
......
......@@ -268,7 +268,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = {
#undef RX_HANDLER_GRP
#define CMD(x) [x] = #x
static const char *const iwl_mvm_cmd_strings[REPLY_MAX] = {
static const char *const iwl_mvm_cmd_strings[REPLY_MAX + 1] = {
CMD(MVM_ALIVE),
CMD(REPLY_ERROR),
CMD(INIT_COMPLETE_NOTIF),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册