[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7fe948a8-debd-e336-9584-e66153e90701@gmail.com>
Date: Fri, 15 Nov 2019 09:59:47 -0700
From: David Ahern <dsahern@...il.com>
To: "wangxiaogang (F)" <wangxiaogang3@...wei.com>, dsahern@...nel.org,
shrijeet@...il.com, davem@...emloft.net
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
hujunwei4@...wei.com, xuhanbing@...wei.com
Subject: Re: [PATCH] vrf: Fix possible NULL pointer oops when delete nic
On 11/14/19 11:22 PM, wangxiaogang (F) wrote:
> diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
> index b8228f5..86c4b8c 100644
> --- a/drivers/net/vrf.c
> +++ b/drivers/net/vrf.c
> @@ -1427,6 +1427,9 @@ static int vrf_device_event(struct notifier_block *unused,
> goto out;
>
> vrf_dev = netdev_master_upper_dev_get(dev);
> + if (!vrf_dev)
> + goto out;
> +
> vrf_del_slave(vrf_dev, dev);
> }
> out:
BTW, I believe this is the wrong fix. A device can not be a VRF slave
AND not have an upper device. Something is fundamentally wrong.
Powered by blists - more mailing lists