ath6kl: fix busreqs so they can be reused when sg is cleaned up
authorJames Minor <james.minor@ni.com>
Mon, 3 Oct 2016 18:00:02 +0000 (13:00 -0500)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 6 Oct 2016 07:14:35 +0000 (10:14 +0300)
To reuse the busreqs in case of hardware restart, they must be
properly reinitialized.  If the scat_req pointer isn't reset to
0, __ath6kl_sdio_write_async() will assume there is sg work to be
done (causing a kernel OOPS).

Signed-off-by: James Minor <james.minor@ni.com>
Reviewed-by: Steve deRosier <steve.derosier@lairdtech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath6kl/sdio.c

index eab0ab9..96ed060 100644 (file)
@@ -703,8 +703,10 @@ static void ath6kl_sdio_cleanup_scatter(struct ath6kl *ar)
                 * ath6kl_hif_rw_comp_handler() with status -ECANCELED so
                 * that the packet is properly freed?
                 */
-               if (s_req->busrequest)
+               if (s_req->busrequest) {
+                       s_req->busrequest->scat_req = 0;
                        ath6kl_sdio_free_bus_req(ar_sdio, s_req->busrequest);
+               }
                kfree(s_req->virt_dma_buf);
                kfree(s_req->sgentries);
                kfree(s_req);