lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220211150352.548530ae@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Fri, 11 Feb 2022 15:03:52 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
        Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Ansuel Smith <ansuelsmth@...il.com>,
        Tobias Waldekranz <tobias@...dekranz.com>,
        DENG Qingfang <dqfext@...il.com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        UNGLinuxDriver@...rochip.com, Jiri Pirko <jiri@...nulli.us>,
        Ivan Vecera <ivecera@...hat.com>
Subject: Re: [PATCH v2 net-next 11/12] net: dsa: support FDB events on
 offloaded LAG interfaces

On Thu, 10 Feb 2022 14:52:00 +0200 Vladimir Oltean wrote:
> +static int
> +dsa_lag_fdb_event(struct net_device *lag_dev, struct net_device *orig_dev,
> +		  unsigned long event, const void *ctx,
> +		  const struct switchdev_notifier_fdb_info *fdb_info)
> +{
> +	struct dsa_switchdev_event_work *switchdev_work;
> +	bool host_addr = fdb_info->is_local;
> +	struct net_device *slave;
> +	struct dsa_switch *ds;
> +	struct dsa_port *dp;
> +
> +	/* Skip dynamic FDB entries, since the physical ports beneath the LAG
> +	 * should have learned it too.
> +	 */
> +	if (netif_is_lag_master(orig_dev) &&
> +	    switchdev_fdb_is_dynamically_learned(fdb_info))
> +		return 0;
> +
> +	/* FDB entries learned by the software bridge should be installed as
> +	 * host addresses only if the driver requests assisted learning.
> +	 */
> +	if (switchdev_fdb_is_dynamically_learned(fdb_info) &&
> +	    !ds->assisted_learning_on_cpu_port)
> +		return 0;
> +
> +	/* Get a handle to any DSA interface beneath the LAG */
> +	slave = switchdev_lower_dev_find(lag_dev, dsa_slave_dev_check,
> +					 dsa_foreign_dev_check);
> +	dp = dsa_slave_to_port(slave);
> +	ds = dp->ds;

clang says:

net/dsa/slave.c:2650:7: warning: variable 'ds' is uninitialized when used here [-Wuninitialized]
           !ds->assisted_learning_on_cpu_port)
            ^~

It also suggests:

net/dsa/slave.c:2636:23: note: initialize the variable 'ds' to silence this warning
       struct dsa_switch *ds;
                            ^
                             = NULL

but that's perhaps for comedic purposes.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ