[dpdk-dev] [PATCH] kni: unregister an unregisterd net_device could cause a kernel crash

Stephen Hemminger stephen at networkplumber.org
Thu Sep 8 18:44:42 CEST 2016


On Fri,  9 Sep 2016 10:46:07 +0800
zhouyangchao <zhouyates at gmail.com> wrote:

> Signed-off-by: zhouyangchao <zhouyates at gmail.com>
> ---
>  lib/librte_eal/linuxapp/kni/kni_misc.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
> index 67e9b7d..ad4e603 100644
> --- a/lib/librte_eal/linuxapp/kni/kni_misc.c
> +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
> @@ -361,7 +361,9 @@ kni_dev_remove(struct kni_dev *dev)
>  		igb_kni_remove(dev->pci_dev);
>  
>  	if (dev->net_dev) {
> -		unregister_netdev(dev->net_dev);
> +		if (dev->netdev->reg_state == NETREG_REGISTERED){
----------------------------------------------------------------^
Incorrect whitespace. But then again the whole KNI driver fails completely when
running kernel style check.


More information about the dev mailing list