diff options
author | PixelBot AutoMerger <android-nexus-securitybot@system.gserviceaccount.com> | 2023-09-17 19:07:01 -0700 |
---|---|---|
committer | SecurityBot <android-nexus-securitybot@system.gserviceaccount.com> | 2023-09-17 19:07:01 -0700 |
commit | ddd28e25118577f6f7c72880a2ff33ae9fcbfaef (patch) | |
tree | cc60bec9f467235e8c5e92194cca644934145973 | |
parent | 97a64ddb9c18696ce5f9f5af9438db6d0a89ab04 (diff) | |
parent | 3f6a07de731c84ea69ce59d9088b7c0c8547918c (diff) | |
download | bcm4398-ddd28e25118577f6f7c72880a2ff33ae9fcbfaef.tar.gz |
Merge android14-gs-pixel-5.15-udc-qpr1 into android14-gs-pixel-5.15-24Q1android-u-qpr2-beta-1_r0.7
SBMerger: 558810260
Change-Id: I808751de340aed3f7d53f901bef8e9c8d75bfd63
Signed-off-by: SecurityBot <android-nexus-securitybot@system.gserviceaccount.com>
-rw-r--r-- | dhd_msgbuf.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/dhd_msgbuf.c b/dhd_msgbuf.c index dfb17c5..eee2cae 100644 --- a/dhd_msgbuf.c +++ b/dhd_msgbuf.c @@ -4018,6 +4018,11 @@ dhd_prot_attach(dhd_pub_t *dhd) /* pre-allocation htput ring */ dhd->prot->prealloc_htput_flowring_buf = MALLOCZ(osh, sizeof(dhd_dma_buf_t)* dhd->htput_total_flowrings); + if (dhd->prot->prealloc_htput_flowring_buf == NULL) { + DHD_ERROR(("%s : malloc of prealloc_htput_flowring_buf failed!\n", + __FUNCTION__)); + goto fail; + } for (i = 0; i < dhd->htput_total_flowrings; i++) { if (dhd_dma_buf_alloc(dhd, &dhd->prot->prealloc_htput_flowring_buf[i], (uint32)(h2d_htput_max_txpost * h2d_txpost_size_prealloc))) { @@ -4038,6 +4043,10 @@ dhd_prot_attach(dhd_pub_t *dhd) /* pre-allocation flow ring */ dhd->prot->prealloc_regular_flowring_buf = MALLOCZ(osh, sizeof(dhd_dma_buf_t) * dhd->max_prealloc_regular_flowrings); + if (dhd->prot->prealloc_regular_flowring_buf == NULL) { + DHD_ERROR(("%s : malloc of prealloc_regular_flowring_buf failed!\n", __FUNCTION__)); + goto fail; + } for (i = 0; i < dhd->max_prealloc_regular_flowrings; i++) { if (dhd_dma_buf_alloc(dhd, &dhd->prot->prealloc_regular_flowring_buf[i], (uint32)(h2d_max_txpost * h2d_txpost_size_prealloc))) { @@ -5036,19 +5045,22 @@ void dhd_prot_detach(dhd_pub_t *dhd) dhd_prot_flowrings_pool_detach(dhd); #ifdef FLOW_RING_PREALLOC - if (dhd->htput_support) { - for (i = 0; i < dhd->htput_total_flowrings; i++) { - dhd_dma_buf_free(dhd, &prot->prealloc_htput_flowring_buf[i]); + if (prot->prealloc_htput_flowring_buf) { + if (dhd->htput_support) { + for (i = 0; i < dhd->htput_total_flowrings; i++) { + dhd_dma_buf_free(dhd, &prot->prealloc_htput_flowring_buf[i]); + } } + MFREE(dhd->osh, prot->prealloc_htput_flowring_buf, + sizeof(dhd_dma_buf_t) * dhd->htput_total_flowrings); } - MFREE(dhd->osh, prot->prealloc_htput_flowring_buf, - sizeof(dhd_dma_buf_t) * dhd->htput_total_flowrings); - - for (i = 0; i < dhd->max_prealloc_regular_flowrings; i++) { - dhd_dma_buf_free(dhd, &prot->prealloc_regular_flowring_buf[i]); + if (prot->prealloc_regular_flowring_buf) { + for (i = 0; i < dhd->max_prealloc_regular_flowrings; i++) { + dhd_dma_buf_free(dhd, &prot->prealloc_regular_flowring_buf[i]); + } + MFREE(dhd->osh, prot->prealloc_regular_flowring_buf, + sizeof(dhd_dma_buf_t) * dhd->max_prealloc_regular_flowrings); } - MFREE(dhd->osh, prot->prealloc_regular_flowring_buf, - sizeof(dhd_dma_buf_t) * dhd->max_prealloc_regular_flowrings); #endif /* FLOW_RING_PREALLOC */ /* detach info rings */ @@ -5182,14 +5194,16 @@ dhd_prot_reset(dhd_pub_t *dhd) dhd_dma_buf_reset(dhd, &prot->d2h_dma_indx_wr_buf); #ifdef FLOW_RING_PREALLOC - if (dhd->htput_support) { + if (dhd->htput_support && prot->prealloc_htput_flowring_buf) { for (i = 0; i < dhd->htput_total_flowrings; i++) { dhd_dma_buf_reset(dhd, &prot->prealloc_htput_flowring_buf[i]); } } - for (i = 0; i < dhd->max_prealloc_regular_flowrings; i++) { - dhd_dma_buf_reset(dhd, &prot->prealloc_regular_flowring_buf[i]); + if (prot->prealloc_regular_flowring_buf) { + for (i = 0; i < dhd->max_prealloc_regular_flowrings; i++) { + dhd_dma_buf_reset(dhd, &prot->prealloc_regular_flowring_buf[i]); + } } #endif /* FLOW_RING_PREALLOC */ |