Re: [PATCH] iommufd/driver: Fix counter initialization for counted_by annotation
From: Jason Gunthorpe
Date: Fri Nov 21 2025 - 14:43:50 EST
On Tue, Nov 11, 2025 at 06:01:24PM +0900, Gustavo A. R. Silva wrote:
> One of the requirements for counted_by annotations is that the counter
> member must be initialized before the first reference to the
> flexible-array member.
>
> Move the vevent->data_len = data_len; initialization to before the
> first access to flexible array vevent->event_data.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: e8e1ef9b77a7 ("iommufd/viommu: Add iommufd_viommu_report_event helper")
> Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
> ---
> drivers/iommu/iommufd/driver.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
Jason