[qca-nss-drv] Resolved crash observed in 64-bit build
IPv6 Connection table memory pointer was wrongly typecasted causing
crash in 64-bit build.
Change-Id: Iabb85307d0a4fe92a3a0b997b90a48578fa9611d
Signed-off-by: Suruchi Agarwal <suruchia@codeaurora.org>
diff --git a/nss_ipv6.c b/nss_ipv6.c
index 73eeea9..6aa4df2 100644
--- a/nss_ipv6.c
+++ b/nss_ipv6.c
@@ -486,8 +486,17 @@
nirccm = &nim.msg.rule_conn_cfg;
nirccm->num_conn = htonl(conn);
- nirccm->ce_mem = (nss_ptr_t)dma_map_single(NULL, (void *)nss_ipv6_ct_info.ce_mem, nss_ipv6_ct_info.ce_table_size, DMA_TO_DEVICE);
- nirccm->cme_mem = (nss_ptr_t)dma_map_single(NULL, (void *)nss_ipv6_ct_info.cme_mem, nss_ipv6_ct_info.cme_table_size, DMA_TO_DEVICE);
+ nirccm->ce_mem = dma_map_single(nss_ctx->dev, (void *)nss_ipv6_ct_info.ce_mem, nss_ipv6_ct_info.ce_table_size, DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(nss_ctx->dev, nirccm->ce_mem))) {
+ nss_warning("%p: DMA mapping failed for virtual address = %p", nss_ctx, (void *)nss_ipv6_ct_info.ce_mem);
+ goto fail;
+ }
+
+ nirccm->cme_mem = dma_map_single(nss_ctx->dev, (void *)nss_ipv6_ct_info.cme_mem, nss_ipv6_ct_info.cme_table_size, DMA_TO_DEVICE);
+ if (unlikely(dma_mapping_error(nss_ctx->dev, nirccm->cme_mem))) {
+ nss_warning("%p: DMA mapping failed for virtual address = %p", nss_ctx, (void *)nss_ipv6_ct_info.cme_mem);
+ goto fail;
+ }
nss_tx_status = nss_ipv6_tx(nss_ctx, &nim);
if (nss_tx_status != NSS_TX_SUCCESS) {