if_ath: ath_tgt_send_beacon assert if beacon exist 120/head
authorOleksij Rempel <linux@rempel-privat.de>
Sun, 27 Nov 2016 06:59:05 +0000 (07:59 +0100)
committerOleksij Rempel <linux@rempel-privat.de>
Fri, 16 Dec 2016 11:23:43 +0000 (12:23 +0100)
With current code we will print error and try to execute something
If bhdr will be accidantly not NULL, then we will continue with some
trash without letting host knwo about it.

In this case it is better to use assert and send to the host at least panic
notification.

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

index 1fb2a7ac90568f4da9c208c376b28ebe2ce05b41..b251940fed5dfba795ca6d2cba8610ad6c39cffd 100755 (executable)
@@ -583,7 +583,7 @@ static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr,
        struct ath_hal *ah = sc->sc_ah;
        struct ath_tx_buf *bf;
        a_uint8_t vap_index, *anbdata;
-       ath_beacon_hdr_t *bhdr;
+       ath_beacon_hdr_t *bhdr = NULL;
        a_uint32_t anblen;
 
        if (!bc_hdr) {
@@ -591,6 +591,7 @@ static void ath_tgt_send_beacon(struct ath_softc_tgt *sc, adf_nbuf_t bc_hdr,
                bhdr = (ath_beacon_hdr_t *)anbdata;
        } else {
                adf_os_print("found bc_hdr! 0x%x\n", bc_hdr);
+               adf_os_assert(0);
        }
 
        vap_index = bhdr->vap_index;