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]
Date:   Tue, 23 Aug 2022 11:44:50 +0200
From:   Steen Hegelund <steen.hegelund@...rochip.com>
To:     Casper Andersson <casper.casan@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>, <netdev@...r.kernel.org>
CC:     Horatiu Vultur <horatiu.vultur@...rochip.com>,
        Lars Povlsen <lars.povlsen@...rochip.com>,
        <UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH net-next 2/3] net: sparx5: add list for mdb entries in
 driver

On Mon, 2022-08-22 at 16:07 +0200, Casper Andersson wrote:
> +static void sparx5_free_mdb_entry(struct sparx5 *sparx5,
> +                                 const unsigned char *addr,
> +                                 u16 vid)
> +{
> +       struct sparx5_mdb_entry *entry, *tmp;
> +
> +       mutex_lock(&sparx5->mdb_lock);
> +       list_for_each_entry_safe(entry, tmp, &sparx5->mdb_entries, list) {
> +               if ((vid == 0 || entry->vid == vid) &&
> +                   ether_addr_equal(addr, entry->addr)) {
> +                       list_del(&entry->list);
> +
> +                       sparx5_pgid_free(sparx5, entry->pgid_idx);
> +
> +                       devm_kfree(sparx5->dev, entry);

Could you not also bail out here, like you do below?

> +               }
> +       }
> +       mutex_unlock(&sparx5->mdb_lock);
> +}
> +
> 
> --
> 2.34.1
> 

BR
Steen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ