From: Oleksij Rempel Date: Sun, 27 Nov 2016 06:59:05 +0000 (+0100) Subject: if_ath: ath_tgt_send_beacon assert if beacon exist X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=7a22b7ce9909ee5cdf163341f414bf376634d6d1;p=open-ath9k-htc-firmware.git if_ath: ath_tgt_send_beacon assert if beacon exist 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 --- diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index 1fb2a7a..b251940 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -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;