]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wil6210: add general initialization/size checks
authorAlexei Avshalom Lazar <ailizaro@codeaurora.org>
Wed, 31 Oct 2018 08:52:17 +0000 (10:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Apr 2020 07:03:12 +0000 (09:03 +0200)
commit ac0e541ab2f2951845acee784ef487be40fb4c77 upstream.

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>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/wil6210/debugfs.c
drivers/net/wireless/ath/wil6210/wmi.c

index 44296c015925200864bb91b3ebe361802015a70b..acd95ca0430b99d7b9fe592df41739c0fa46cbee 100644 (file)
@@ -991,6 +991,8 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
        int rc;
        void *frame;
 
+       memset(&params, 0, sizeof(params));
+
        if (!len)
                return -EINVAL;
 
index 8a603432f531786abdfbaeed583fa25facda79fb..3928b13ae0266d6b3a00217fe594d6bf32adc17d 100644 (file)
@@ -2802,7 +2802,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;