Skip to content

Commit 38c02d8

Browse files
tititiou36rleon
authored andcommitted
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]>
1 parent 435cdbe commit 38c02d8

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/hw/irdma

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/irdma/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct irdma_qv_info {
239239

240240
struct irdma_qvlist_info {
241241
u32 num_vectors;
242-
struct irdma_qv_info qv_info[];
242+
struct irdma_qv_info qv_info[] __counted_by(num_vectors);
243243
};
244244

245245
struct irdma_gen_ops {

0 commit comments

Comments
 (0)