diff options
author | Hongbo Li <lihongbo22@huawei.com> | 2024-09-04 04:49:56 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-09-05 14:01:01 +0300 |
commit | 50ddaedeae7562b25e8eeca04f581d7c815be1db (patch) | |
tree | 4bbe682987f676e1ddf0a30ab06e9b38ea23ecbb /drivers/net/dsa/ocelot | |
parent | ed42b2bcd38e95a967287273144a7c7a1dbc97cb (diff) | |
download | linux-50ddaedeae7562b25e8eeca04f581d7c815be1db.tar.xz |
net: dsa: felix: Annotate struct action_gate_entry with __counted_by
Add the __counted_by compiler attribute to the flexible array member
entries to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and
CONFIG_FORTIFY_SOURCE.
Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Link: https://patch.msgid.link/20240904014956.2035117-1-lihongbo22@huawei.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/dsa/ocelot')
-rw-r--r-- | drivers/net/dsa/ocelot/felix_vsc9959.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/ocelot/felix_vsc9959.c b/drivers/net/dsa/ocelot/felix_vsc9959.c index ba37a566da39..73d053501fb1 100644 --- a/drivers/net/dsa/ocelot/felix_vsc9959.c +++ b/drivers/net/dsa/ocelot/felix_vsc9959.c @@ -1733,7 +1733,7 @@ struct felix_stream_gate { u64 cycletime; u64 cycletime_ext; u32 num_entries; - struct action_gate_entry entries[]; + struct action_gate_entry entries[] __counted_by(num_entries); }; struct felix_stream_gate_entry { |