From da5cb4bf53d91fef84c1e9cbac3cbd6134dee875 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sun, 27 Nov 2016 07:43:17 +0100 Subject: [PATCH 1/3] fix -Wmaybe-uninitialized warnings in dbg_api.c Signed-off-by: Oleksij Rempel --- target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c b/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c index 583ca57..04dce3d 100755 --- a/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c +++ b/target_firmware/magpie_fw_dev/target/cmnos/dbg_api.c @@ -442,7 +442,7 @@ int db_help_cmd(char *cmd, char *param1, char *param2, char *param3) static int db_ldr_cmd(char *cmd, char *param1, char *param2, char *param3) { - unsigned long val; + unsigned long val = 0; unsigned long addr; char val_str[20]; char addr_str[20]; From e9f0b338a161efc530b9a09427f098c1e26529d1 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sun, 27 Nov 2016 07:52:44 +0100 Subject: [PATCH 2/3] if_ath: use datalen instead of data in ath_stop_tx_dma_tgt 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 --- target_firmware/wlan/if_ath.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/target_firmware/wlan/if_ath.c b/target_firmware/wlan/if_ath.c index b31fbdb..1fb2a7a 100755 --- a/target_firmware/wlan/if_ath.c +++ b/target_firmware/wlan/if_ath.c @@ -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); } From 7a22b7ce9909ee5cdf163341f414bf376634d6d1 Mon Sep 17 00:00:00 2001 From: Oleksij Rempel Date: Sun, 27 Nov 2016 07:59:05 +0100 Subject: [PATCH 3/3] 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;