diff options
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/htc_pipe.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/htc_pipe.c b/drivers/net/wireless/ath/ath6kl/htc_pipe.c index 73a38f9392f9..281390178e3d 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_pipe.c +++ b/drivers/net/wireless/ath/ath6kl/htc_pipe.c | |||
@@ -967,6 +967,22 @@ static int ath6kl_htc_pipe_rx_complete(struct ath6kl *ar, struct sk_buff *skb, | |||
967 | u16 payload_len; | 967 | u16 payload_len; |
968 | int status = 0; | 968 | int status = 0; |
969 | 969 | ||
970 | /* | ||
971 | * ar->htc_target can be NULL due to a race condition that can occur | ||
972 | * during driver initialization(we do 'ath6kl_hif_power_on' before | ||
973 | * initializing 'ar->htc_target' via 'ath6kl_htc_create'). | ||
974 | * 'ath6kl_hif_power_on' assigns 'ath6kl_recv_complete' as | ||
975 | * usb_complete_t/callback function for 'usb_fill_bulk_urb'. | ||
976 | * Thus the possibility of ar->htc_target being NULL | ||
977 | * via ath6kl_recv_complete -> ath6kl_usb_io_comp_work. | ||
978 | */ | ||
979 | if (WARN_ON_ONCE(!target)) { | ||
980 | ath6kl_err("Target not yet initialized\n"); | ||
981 | status = -EINVAL; | ||
982 | goto free_skb; | ||
983 | } | ||
984 | |||
985 | |||
970 | netdata = skb->data; | 986 | netdata = skb->data; |
971 | netlen = skb->len; | 987 | netlen = skb->len; |
972 | 988 | ||