Fix a list handling error in netdev_unregister(). From Max Neklyudov

This commit is contained in:
Gregory Nutt 2015-02-27 08:01:31 -06:00
parent 6a551ddc84
commit 19f3d46eb0

View File

@ -1,7 +1,7 @@
/**************************************************************************** /****************************************************************************
* net/netdev/netdev_unregister.c * net/netdev/netdev_unregister.c
* *
* Copyright (C) 2011 Gregory Nutt. All rights reserved. * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -65,7 +65,7 @@
#endif #endif
/**************************************************************************** /****************************************************************************
* Priviate Types * Private Types
****************************************************************************/ ****************************************************************************/
/**************************************************************************** /****************************************************************************
@ -133,7 +133,7 @@ int netdev_unregister(FAR struct net_driver_s *dev)
{ {
/* The entry was at the beginning of the list */ /* The entry was at the beginning of the list */
g_netdevices = curr; g_netdevices = curr->flink;
} }
curr->flink = NULL; curr->flink = NULL;