[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251201141638.00a986dd@kernel.org>
Date: Mon, 1 Dec 2025 14:16:38 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Parvathi Pudi <parvathi@...thit.com>
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, danishanwar@...com, rogerq@...nel.org,
pmohan@...thit.com, basharath@...thit.com, afd@...com,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, alok.a.tiwari@...cle.com,
horms@...nel.org, pratheesh@...com, j-rameshbabu@...com, vigneshr@...com,
praneeth@...com, srk@...com, rogerq@...com, krishna@...thit.com,
mohan@...thit.com
Subject: Re: [PATCH net-next v8 2/3] net: ti: icssm-prueth: Add switchdev
support for icssm_prueth driver
On Wed, 26 Nov 2025 21:57:13 +0530 Parvathi Pudi wrote:
> + */
> +static void icssm_prueth_sw_switchdev_event_work(struct work_struct *work)
> +{
> + struct icssm_prueth_sw_switchdev_event_work *switchdev_work =
> + container_of(work,
> + struct icssm_prueth_sw_switchdev_event_work, work);
Consider using shorter type names.
> + struct prueth_emac *emac = switchdev_work->emac;
> + struct switchdev_notifier_fdb_info *fdb;
> + struct prueth *prueth = emac->prueth;
> + int port = emac->port_id;
> +
> + rtnl_lock();
> +
> + /* Interface is not up */
> + if (!emac->prueth->fdb_tbl) {
> + rtnl_unlock();
Are you not leaking the device reference here?
> + return;
> + }
> +
> + switch (switchdev_work->event) {
> + case SWITCHDEV_FDB_ADD_TO_DEVICE:
> + fdb = &switchdev_work->fdb_info;
> + dev_dbg(prueth->dev,
> + "prueth fdb add: MACID = %pM vid = %u flags = %u -- port %d\n",
> + fdb->addr, fdb->vid, fdb->added_by_user, port);
> +
> + if (!fdb->added_by_user)
> + break;
> +
> + if (fdb->is_local)
> + break;
> +
> + icssm_prueth_sw_fdb_add(emac, fdb);
> + icssm_prueth_sw_fdb_offload_notify(emac->ndev, fdb);
> + break;
> + case SWITCHDEV_FDB_DEL_TO_DEVICE:
> + fdb = &switchdev_work->fdb_info;
> + dev_dbg(prueth->dev,
> + "prueth fdb del: MACID = %pM vid = %u flags = %u -- port %d\n",
> + fdb->addr, fdb->vid, fdb->added_by_user, port);
> +
> + if (fdb->is_local)
> + break;
> +
> + icssm_prueth_sw_fdb_del(emac, fdb);
> + break;
> + default:
> + break;
> + }
> + rtnl_unlock();
> +
> + netdev_put(emac->ndev, &switchdev_work->ndev_tracker);
> + kfree(switchdev_work->fdb_info.addr);
> + kfree(switchdev_work);
--
pw-bot: cr
Powered by blists - more mailing lists