wil6210: add general initialization/size checks
Initialize unset variable, and verify that mid is valid. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Maya Erez <merez@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
b571e71bcb
commit
ac0e541ab2
@ -962,6 +962,8 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
|
||||
int rc;
|
||||
void *frame;
|
||||
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
|
||||
if (!len)
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -3148,7 +3148,7 @@ static void wmi_event_handle(struct wil6210_priv *wil,
|
||||
|
||||
if (mid == MID_BROADCAST)
|
||||
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",
|
||||
mid);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user