From 7a22b7ce9909ee5cdf163341f414bf376634d6d1 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sun, 27 Nov 2016 07:59:05 +0100 Subject: [PATCH] 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 --- target_firmware/wlan/if_ath.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.25.1