Merge pull request #110 from qiyongzhong0/fix_bc26_netdev_add

fix bc26_netdev_add
This commit is contained in:
ChenYong 2020-04-26 09:31:14 +08:00 committed by GitHub
commit d21fd8fec8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -631,6 +631,12 @@ static struct netdev *bc26_netdev_add(const char *netdev_name)
#define HWADDR_LEN 8
struct netdev *netdev = RT_NULL;
netdev = netdev_get_by_name(netdev_name);
if(netdev != RT_NULL)
{
return(netdev);
}
netdev = (struct netdev *)rt_calloc(1, sizeof(struct netdev));
if (netdev == RT_NULL)
{