提交 ac0e541a 编写于 作者: A Alexei Avshalom Lazar 提交者: Kalle Valo

wil6210: add general initialization/size checks

Initialize unset variable, and verify that mid is valid.
Signed-off-by: NAlexei Avshalom Lazar <ailizaro@codeaurora.org>
Signed-off-by: NMaya Erez <merez@codeaurora.org>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
上级 b571e71b
...@@ -962,6 +962,8 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf, ...@@ -962,6 +962,8 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
int rc; int rc;
void *frame; void *frame;
memset(&params, 0, sizeof(params));
if (!len) if (!len)
return -EINVAL; return -EINVAL;
......
...@@ -3148,7 +3148,7 @@ static void wmi_event_handle(struct wil6210_priv *wil, ...@@ -3148,7 +3148,7 @@ static void wmi_event_handle(struct wil6210_priv *wil,
if (mid == MID_BROADCAST) if (mid == MID_BROADCAST)
mid = 0; mid = 0;
if (mid >= wil->max_vifs) { if (mid >= ARRAY_SIZE(wil->vifs) || mid >= wil->max_vifs) {
wil_dbg_wmi(wil, "invalid mid %d, event skipped\n", wil_dbg_wmi(wil, "invalid mid %d, event skipped\n",
mid); mid);
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册