Re: [PATCH v2 11/14] NTB: ntb_transport: Prepare remote RX info accesses for MW teardown

From: Logan Gunthorpe

Date: Fri Sep 18 2026 - 14:14:55 EST




On 2026-09-09 22:08, Koichiro Den wrote:
> The next patch clears remote_rx_info when freeing its MW.
> ntb_transport_tx_free_entry() and debugfs stats reads can run during
> link cleanup, so make them handle a NULL pointer.
>
> The pointer is accessed locklessly. Use READ_ONCE() and WRITE_ONCE()
> to prevent compiler-induced tearing, and retain the read value so
> the NULL check and dereference use the same pointer.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>

Looks good to me:

Reviewed-by: Logan Gunthorpe <logang@xxxxxxxxxxxx>