Commit ac0e541a authored by Alexei Avshalom Lazar's avatar Alexei Avshalom Lazar Committed by Kalle Valo

wil6210: add general initialization/size checks

Initialize unset variable, and verify that mid is valid.
Signed-off-by: default avatarAlexei Avshalom Lazar <ailizaro@codeaurora.org>
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment