linux/drivers/infiniband/hw/ionic
Abhijit Gangurde cf3ebd89e7 RDMA/ionic: Embed counter driver data in rdma_counter allocation
Commit 7e53b31acc ("RDMA/core: Create and destroy rdma_counter using
rdma_zalloc_drv_obj()") requires drivers implementing counter ops to
embed struct rdma_counter in a driver-specific struct, register its size
via INIT_RDMA_OBJ_SIZE, and provide a counter_init callback.

The ionic driver was merged without this adaptation, causing a NULL
pointer dereference in alloc_and_bind() since rdma_zalloc_drv_obj()
allocates zero bytes when size_rdma_counter is unset.

Consolidate struct ionic_counter into a new struct ionic_rdma_counter
that embeds struct rdma_counter, replace the xarray with a lightweight
ida for ID allocation, and add the required counter_init and
INIT_RDMA_OBJ_SIZE declarations.

Fixes: ea4c399642 ("RDMA/ionic: Implement device stats ops")
Cc: stable@vger.kernel.org # 6.18
Signed-off-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
Link: https://patch.msgid.link/20260805053254.4023262-2-abhijit.gangurde@amd.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
2026-08-06 07:21:21 -04:00
..
ionic_admin.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
ionic_controlpath.c RDMA/ionic: map PHC state into user space 2026-07-22 04:53:36 -04:00
ionic_datapath.c RDMA/ionic: add completion timestamp to CQE format 2026-07-22 04:53:36 -04:00
ionic_fw.h RDMA/ionic: add completion timestamp to CQE format 2026-07-22 04:53:36 -04:00
ionic_hw_stats.c RDMA/ionic: Embed counter driver data in rdma_counter allocation 2026-08-06 07:21:21 -04:00
ionic_ibdev.c RDMA/ionic: Add robust udata compatibility checks to all uapi verbs 2026-07-20 09:45:44 -04:00
ionic_ibdev.h RDMA/ionic: Embed counter driver data in rdma_counter allocation 2026-08-06 07:21:21 -04:00
ionic_lif_cfg.c RDMA/ionic: Cap eq_count to the eth driver's interrupt vector budget 2026-08-06 07:21:21 -04:00
ionic_lif_cfg.h RDMA/ionic: map PHC state into user space 2026-07-22 04:53:36 -04:00
ionic_pgtbl.c RDMA/ionic: Register device ops for datapath 2025-09-11 02:18:36 -04:00
ionic_queue.c
ionic_queue.h
ionic_res.h
Kconfig RDMA/ionic: Add Makefile/Kconfig to kernel build environment 2025-09-11 02:18:36 -04:00
Makefile RDMA/ionic: Add Makefile/Kconfig to kernel build environment 2025-09-11 02:18:36 -04:00