diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2021-10-26 17:27:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-10-27 14:54:02 +0100 |
commit | fab9eca88410ddd22e4c4bb275849b8327b49a60 (patch) | |
tree | 565bed9f31f026fa883518f5bca8ebeba67cf56e /net/switchdev/switchdev.c | |
parent | 5cda5272a4605c34740859378bf7a7940229feca (diff) |
net: bridge: create a common function for populating switchdev FDB entries
There are two places where a switchdev FDB entry is constructed, one is
br_switchdev_fdb_notify() and the other is br_fdb_replay(). One uses a
struct initializer, and the other declares the structure as
uninitialized and populates the elements one by one.
One problem when introducing new members of struct
switchdev_notifier_fdb_info is that there is a risk for one of these
functions to run with an uninitialized value.
So centralize the logic of populating such structure into a dedicated
function. Being the primary location where these structures are created,
using an uninitialized variable and populating the members one by one
should be fine, since this one function is supposed to assign values to
all its members.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions