if_ath: use datalen instead of data in ath_stop_tx_dma_tgt
authorOleksij Rempel <linux@rempel-privat.de>
Sun, 27 Nov 2016 06:52:44 +0000 (07:52 +0100)
committerOleksij Rempel <linux@rempel-privat.de>
Fri, 16 Dec 2016 11:23:26 +0000 (12:23 +0100)
one more potential issue wich where we use data pointer instead of datalen.

NOTE: Currently this functions seems to be not used.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
target_firmware/wlan/if_ath.c

index b31fbdb67e866d883732f14ca4171515015bbfbd..1fb2a7ac90568f4da9c208c376b28ebe2ce05b41 100755 (executable)
@@ -1613,11 +1613,14 @@ static void ath_stop_tx_dma_tgt(void *Context, A_UINT16 Command,
        struct ath_hal *ah = sc->sc_ah;
        a_uint32_t q;
 
-       if (data)
-               q = *(a_uint32_t *)data;
+       if (!datalen)
+               goto done;
+
+       q = *(a_uint32_t *)data;
 
        q = adf_os_ntohl(q);
        ah->ah_stopTxDma(ah, q);
+done:
        wmi_cmd_rsp(sc->tgt_wmi_handle, Command, SeqNo, NULL, 0);
 }