summaryrefslogtreecommitdiff
path: root/dhd_msgbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'dhd_msgbuf.c')
-rw-r--r--dhd_msgbuf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/dhd_msgbuf.c b/dhd_msgbuf.c
index 6768e4f..4bc1d1a 100644
--- a/dhd_msgbuf.c
+++ b/dhd_msgbuf.c
@@ -7240,10 +7240,6 @@ dhd_prot_update_txflowring(dhd_pub_t *dhd, uint16 flowid, void *msgring)
DHD_ERROR(("%s: NULL txflowring. exiting...\n", __FUNCTION__));
return FALSE;
}
- /* Update read pointer */
- if (dhd->dma_d2h_ring_upd_support) {
- ring->rd = dhd_prot_dma_indx_get(dhd, H2D_DMA_INDX_RD_UPD, ring->idx);
- }
DHD_TRACE(("ringid %d flowid %d write %d read %d \n\n",
ring->idx, flowid, ring->wr, ring->rd));
@@ -7754,6 +7750,7 @@ dhd_prot_ioctcmplt_process(dhd_pub_t *dhd, void *msg)
#ifdef REPORT_FATAL_TIMEOUTS
uint16 dhd_xt_id;
#endif
+ int ret = 0;
/* Check for ioctl timeout induce flag, which is set by firing
* dhd iovar to induce IOCTL timeout. If flag is set,
@@ -7849,11 +7846,18 @@ dhd_prot_ioctcmplt_process(dhd_pub_t *dhd, void *msg)
pkt_id, xt_id, prot->ioctl_status, prot->ioctl_resplen));
if (prot->ioctl_resplen > 0) {
+ uint16 copy_len = MIN(prot->ioctl_resplen, prot->retbuf.len);
#ifndef IOCTLRESP_USE_CONSTMEM
- bcopy(PKTDATA(dhd->osh, pkt), prot->retbuf.va, prot->ioctl_resplen);
+ ret = memcpy_s(prot->retbuf.va, prot->retbuf.len, PKTDATA(dhd->osh, pkt), copy_len);
#else
- bcopy(pkt, prot->retbuf.va, prot->ioctl_resplen);
+ ret = memcpy_s(prot->retbuf.va, prot->retbuf.len, pkt, copy_len);
#endif /* !IOCTLRESP_USE_CONSTMEM */
+ if (ret) {
+ DHD_ERROR(("memcpy failed:%d, destsz:%d, n:%u\n",
+ ret, prot->retbuf.len, copy_len));
+ dhd_wakeup_ioctl_event(dhd, IOCTL_RETURN_ON_ERROR);
+ goto exit;
+ }
}
/* wake up any dhd_os_ioctl_resp_wait() */