diff
+#define SAFE_FREE(ptr) do { if (ptr) { kfree(ptr); ptr = NULL; } } while (0)

-	kfree(mcam->counters.bmap);
+	SAFE_FREE(mcam->counters.bmap);
