net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe()
authorWang Hai <wanghai38@huawei.com>
Wed, 19 Aug 2020 02:33:09 +0000 (10:33 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Aug 2020 23:37:18 +0000 (16:37 -0700)
commitcf96d977381d4a23957bade2ddf1c420b74a26b6
tree9399780e1c8a87cb1ca77bcd6a1d1d171e717650
parent9553b62c1dd27df67ab2f52ec8a3bc3501887619
net: gemini: Fix missing free_netdev() in error path of gemini_ethernet_port_probe()

Replace alloc_etherdev_mq with devm_alloc_etherdev_mqs. In this way,
when probe fails, netdev can be freed automatically.

Fixes: 4d5ae32f5e1e ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cortina/gemini.c