diff options
author | Ido Schimmel <[email protected]> | 2020-08-26 19:48:51 +0300 |
---|---|---|
committer | David S. Miller <[email protected]> | 2020-08-26 16:00:51 -0700 |
commit | d7d49dc77c8db113393a31aced3f0562f4afd439 (patch) | |
tree | 2958bcbc5c645f138d841e624b66122f056b6900 /drivers/fpga/fpga-bridge.c | |
parent | 751e42515efbe00cf8fe8c8bb160a207364dbb2b (diff) |
ipv4: nexthop: Reduce allocation size of 'struct nh_group'
The struct looks as follows:
struct nh_group {
struct nh_group *spare; /* spare group for removals */
u16 num_nh;
bool mpath;
bool fdb_nh;
bool has_v4;
struct nh_grp_entry nh_entries[];
};
But its offset within 'struct nexthop' is also taken into account to
determine the allocation size.
Instead, use struct_size() to allocate only the required number of
bytes.
Signed-off-by: Ido Schimmel <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-bridge.c')
0 files changed, 0 insertions, 0 deletions