wil6210: fix _desc access in __wil_tx_vring_tso
authorAlexei Avshalom Lazar <ailizaro@codeaurora.org>
Fri, 26 Apr 2019 15:43:30 +0000 (18:43 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 3 May 2019 05:03:42 +0000 (08:03 +0300)
_desc is defined in __wil_tx_vring_tso() and may not be set in
case len is 0, verify _desc is set.

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>
drivers/net/wireless/ath/wil6210/txrx.c

index d74837cce67f0f599f3b11c53c474e5c59774bd4..c5e16b2145f80eac606d2ec96c855e14006f7466 100644 (file)
@@ -1761,6 +1761,9 @@ static int __wil_tx_vring_tso(struct wil6210_priv *wil, struct wil6210_vif *vif,
                }
        }
 
+       if (!_desc)
+               goto mem_error;
+
        /* first descriptor may also be the last.
         * in this case d pointer is invalid
         */