[qca-nss-drv] removing BUG_ON as it crashes when slub debug is enabled
We hit a BUG_ON when we enable CONFIG_SLUB_DEBUG in
the following code snippet.
void *kern_addr = kzalloc(PAGE_SIZE, GFP_ATOMIC);
if (!kern_addr) {
BUG_ON(!page_count);
break;
}
BUG_ON((long unsigned int)kern_addr % PAGE_SIZE);
We hit the last BUG_ON when slub debug is enabled.
We remove this BUG_ON as we do not require this check
Change-Id: I6c81bf8c502664544a23d5a39d5a40b3e4db816a
Signed-off-by: Tallapragada <ktallapr@codeaurora.org>
diff --git a/nss_n2h.c b/nss_n2h.c
index ff31b04..17368e9 100644
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -899,7 +899,7 @@
* Send Message to NSS to enable pbufs.
*/
static nss_tx_status_t nss_n2h_buf_pool_cfg(struct nss_ctx_instance *nss_ctx,
- int buf_pool_size, nss_core_id_t core_num)
+ int buf_pool_size, nss_core_id_t core_num)
{
static struct nss_n2h_msg nnm;
struct nss_n2h_buf_pool *buf_pool;
@@ -923,13 +923,11 @@
buf_pool->nss_buf_page_size = PAGE_SIZE;
for (page_count = 0; page_count < MAX_PAGES_PER_MSG && num_pages; page_count++, num_pages--) {
-
void *kern_addr = kzalloc(PAGE_SIZE, GFP_ATOMIC);
if (!kern_addr) {
BUG_ON(!page_count);
break;
}
- BUG_ON((long unsigned int)kern_addr % PAGE_SIZE);
buf_pool->nss_buf_pool_vaddr[page_count] = kern_addr;
buf_pool->nss_buf_pool_addr[page_count] = dma_map_single(NULL, kern_addr, PAGE_SIZE, DMA_TO_DEVICE);