netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"open list:DPAA2 ETHERNET SWITCH DRIVER" 
	<linux-kernel@vger.kernel.org>,
	"open list:STAGING SUBSYSTEM" <devel@driverdev.osuosl.org>
Subject: RE: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
Date: Sat, 23 Feb 2019 08:45:24 +0000	[thread overview]
Message-ID: <VI1PR0402MB28009A8333F247A753F44F94E0780@VI1PR0402MB2800.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20190222220214.25401-1-f.fainelli@gmail.com>


> Subject: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
> 
> port_switchdev_event() does not check that the target network device is
> actually backed by the ethsw driver, this could be problematic in a stacked
> environment case.
> 

Just FYI, I sent a patch set containing a similar patch verifying if the netdev is backed by the ethsw:
https://lkml.org/lkml/2019/2/6/216

I sent the entire patch set against the staging tree.

Ioana C

> Fixes: 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet
> Switch driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-
> dpaa2/ethsw/ethsw.c
> index daabaceeea52..2edd82f5229a 100644
> --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
> +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
> @@ -1047,6 +1047,9 @@ static int port_switchdev_event(struct notifier_block
> *unused,
>  	struct ethsw_switchdev_event_work *switchdev_work;
>  	struct switchdev_notifier_fdb_info *fdb_info = ptr;
> 
> +	if (!ethsw_port_dev_check(dev))
> +		return NOTIFY_DONE;
> +
>  	switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
>  	if (!switchdev_work)
>  		return NOTIFY_BAD;
> --
> 2.17.1


  reply	other threads:[~2019-02-23  8:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 22:02 [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check Florian Fainelli
2019-02-23  8:45 ` Ioana Ciornei [this message]
2019-02-24 16:17   ` Florian Fainelli
2019-02-25  9:43     ` Ioana Ciornei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0402MB28009A8333F247A753F44F94E0780@VI1PR0402MB2800.eurprd04.prod.outlook.com \
    --to=ioana.ciornei@nxp.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=ruxandra.radulescu@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).