diff options
author | Christophe JAILLET <[email protected]> | 2024-05-19 09:02:15 +0200 |
---|---|---|
committer | Leon Romanovsky <[email protected]> | 2024-05-30 15:14:19 +0300 |
commit | 38c02d813aa321c0e79b9887da6a2e2b57a75698 (patch) | |
tree | 5866f5c7e5cb84ec25465d7338ae229e63d51ed0 | |
parent | 435cdbe9f7a879209807a7519512f94f0b4367c3 (diff) |
RDMA/irdma: Annotate flexible array with __counted_by() in struct irdma_qvlist_info
'num_vectors' is used to count the number of elements in the 'qv_info'
flexible array in "struct irdma_qvlist_info".
So annotate it with __counted_by() to make it explicit and enable some
additional checks.
This allocation is done in irdma_save_msix_info().
Signed-off-by: Christophe JAILLET <[email protected]>
Link: https://lore.kernel.org/r/2ca8b14adf79c4795d7aa95bbfc79253a6bfed82.1716102112.git.christophe.jaillet@wanadoo.fr
Acked-by: Shiraz Saleem <[email protected]>
Signed-off-by: Leon Romanovsky <[email protected]>
-rw-r--r-- | drivers/infiniband/hw/irdma/main.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/irdma/main.h b/drivers/infiniband/hw/irdma/main.h index b65bc2ea542f..9f0ed6e84471 100644 --- a/drivers/infiniband/hw/irdma/main.h +++ b/drivers/infiniband/hw/irdma/main.h @@ -239,7 +239,7 @@ struct irdma_qv_info { struct irdma_qvlist_info { u32 num_vectors; - struct irdma_qv_info qv_info[]; + struct irdma_qv_info qv_info[] __counted_by(num_vectors); }; struct irdma_gen_ops { |