Re: [PATCH] RDMA/bnxt_re: check debugfs parameter allocation
From: Jason Gunthorpe
Date: Wed Jun 10 2026 - 13:27:32 EST
On Sat, Jun 06, 2026 at 12:06:44PM +0800, Ruoyu Wang wrote:
> bnxt_re_debugfs_add_pdev() allocates per-file private data for the CC
> configuration debugfs entries. The loop that initializes those entries
> uses rdev->cc_config_params immediately, so allocation failure would lead
> to NULL pointer dereferences while setting up debugfs.
>
> Debugfs is best-effort. If the CC configuration private data cannot be
> allocated, skip those entries and continue with the independent CQ
> coalescing debugfs setup.
>
> Signed-off-by: Ruoyu Wang <ruoyuw560@xxxxxxxxx>
> ---
> drivers/infiniband/hw/bnxt_re/debugfs.c | 3 +++
> 1 file changed, 3 insertions(+)
Applied though
> rdev->cc_config_params = kzalloc_obj(*cc_params);
> + if (!rdev->cc_config_params)
> + goto init_cq_coal;
I changed this to just return, there is no point in continuing to
setup as the machine is probably dead if this fails.
Thanks,
Jason