Search Linux Wireless

Re: [PATCH 7/9] ath10k: add extra sanity check when popping amsdu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michal Kazior <michal.kazior@xxxxxxxxx> writes:

> The netbuf pop can return NULL. Make sure to check
> for that. It shouldn't happen but better safe than
> sorry.
>
> Signed-off-by: Michal Kazior <michal.kazior@xxxxxxxxx>
> ---
>  drivers/net/wireless/ath/ath10k/htt_rx.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
> index 7fa4d87..ddb9fe9 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_rx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
> @@ -428,6 +428,15 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,
>  		while (msdu_chained--) {
>  			struct sk_buff *next = ath10k_htt_rx_netbuf_pop(htt);
>  
> +			if (!next) {
> +				ath10k_err(ar, "failed to pop chained msdu\n");

ath10k_warn() is better here, right? I have folded this diff to the patch:

--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -429,7 +429,7 @@ static int ath10k_htt_rx_amsdu_pop(struct ath10k_htt *htt,
                        struct sk_buff *next = ath10k_htt_rx_netbuf_pop(htt);
 
                        if (!next) {
-                               ath10k_err(ar, "failed to pop chained msdu\n");
+                               ath10k_warn(ar, "failed to pop chained msdu\n");
                                ath10k_htt_rx_free_msdu_chain(*head_msdu);
                                *head_msdu = NULL;
                                msdu = NULL;

Full commit:

https://github.com/kvalo/ath/commit/03f316720d664a79e874c13df1e86a64c5f2bf5f

-- 
Kalle Valo
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux