net: fix a leak in register_netdevice()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 3 Dec 2019 14:12:39 +0000 (17:12 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Dec 2019 19:19:29 +0000 (11:19 -0800)
commit42c17fa69f9866a3f80ac196ce70b4fda1242717
tree9d622ebc4023504e95cabcb249bcdac3771ddf7b
parent56e7a2f83d13306500ce807dd7ebbbb73b5a91d6
net: fix a leak in register_netdevice()

We have to free "dev->name_node" on this error path.

Fixes: ff92741270bf ("net: introduce name_node struct to be used in hashlist")
Reported-by: syzbot+6e13e65ffbaa33757bcb@syzkaller.appspotmail.com
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c