Commit 20680907 authored by Alexei Avshalom Lazar's avatar Alexei Avshalom Lazar Committed by Greg Kroah-Hartman

wil6210: add general initialization/size checks

commit ac0e541a upstream.

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>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ced3402c
...@@ -991,6 +991,8 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf, ...@@ -991,6 +991,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;
......
...@@ -2802,7 +2802,7 @@ static void wmi_event_handle(struct wil6210_priv *wil, ...@@ -2802,7 +2802,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