work.work);
        struct nicvf *nic = container_of(vf_work, struct nicvf, rx_mode_work);
        union nic_mbx mbx = {};
-       struct xcast_addr *xaddr, *next;
+       int idx;
 
        if (!vf_work)
                return;
        /* check if we have any specific MACs to be added to PF DMAC filter */
        if (vf_work->mc) {
                /* now go through kernel list of MACs and add them one by one */
-               list_for_each_entry_safe(xaddr, next,
-                                        &vf_work->mc->list, list) {
+               for (idx = 0; idx < vf_work->mc->count; idx++) {
                        mbx.xcast.msg = NIC_MBOX_MSG_ADD_MCAST;
-                       mbx.xcast.data.mac = xaddr->addr;
+                       mbx.xcast.data.mac = vf_work->mc->mc[idx];
                        nicvf_send_msg_to_pf(nic, &mbx);
-
-                       /* after receiving ACK from PF release memory */
-                       list_del(&xaddr->list);
-                       kfree(xaddr);
-                       vf_work->mc->count--;
                }
                kfree(vf_work->mc);
        }
                        mode |= BGX_XCAST_MCAST_FILTER;
                        /* here we need to copy mc addrs */
                        if (netdev_mc_count(netdev)) {
-                               struct xcast_addr *xaddr;
-
-                               mc_list = kmalloc(sizeof(*mc_list), GFP_ATOMIC);
-                               INIT_LIST_HEAD(&mc_list->list);
+                               mc_list = kmalloc(offsetof(typeof(*mc_list),
+                                                          mc[netdev_mc_count(netdev)]),
+                                                 GFP_ATOMIC);
+                               if (unlikely(!mc_list))
+                                       return;
+                               mc_list->count = 0;
                                netdev_hw_addr_list_for_each(ha, &netdev->mc) {
-                                       xaddr = kmalloc(sizeof(*xaddr),
-                                                       GFP_ATOMIC);
-                                       xaddr->addr =
+                                       mc_list->mc[mc_list->count] =
                                                ether_addr_to_u64(ha->addr);
-                                       list_add_tail(&xaddr->list,
-                                                     &mc_list->list);
                                        mc_list->count++;
                                }
                        }