int type, bool add);
 static int nix_setup_ipolicers(struct rvu *rvu,
                               struct nix_hw *nix_hw, int blkaddr);
-static void nix_ipolicer_freemem(struct nix_hw *nix_hw);
+static void nix_ipolicer_freemem(struct rvu *rvu, struct nix_hw *nix_hw);
 static int nix_verify_bandprof(struct nix_cn10k_aq_enq_req *req,
                               struct nix_hw *nix_hw, u16 pcifunc);
 static int nix_free_all_bandprof(struct rvu *rvu, u16 pcifunc);
                        kfree(txsch->schq.bmap);
                }
 
-               nix_ipolicer_freemem(nix_hw);
+               nix_ipolicer_freemem(rvu, nix_hw);
 
                vlan = &nix_hw->txvlan;
                kfree(vlan->rsrc.bmap);
        return 0;
 }
 
-static void nix_ipolicer_freemem(struct nix_hw *nix_hw)
+static void nix_ipolicer_freemem(struct rvu *rvu, struct nix_hw *nix_hw)
 {
        struct nix_ipolicer *ipolicer;
        int layer;
 
+       if (!rvu->hw->cap.ipolicer)
+               return;
+
        for (layer = 0; layer < BAND_PROF_NUM_LAYERS; layer++) {
                ipolicer = &nix_hw->ipolicer[layer];