mac80211_hwsim: fix incorrect dev_alloc_name failure goto
authorMichael Vassernis <michael.vassernis@tandemg.com>
Thu, 3 Oct 2019 07:31:38 +0000 (07:31 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 4 Oct 2019 11:59:48 +0000 (13:59 +0200)
If dev_alloc_name fails, hwsim_mon's memory allocated in alloc_netdev
needs to be freed.
Change goto command in dev_alloc_name failure to out_free_mon in
order to perform free_netdev.

Signed-off-by: Michael Vassernis <michael.vassernis@tandemg.com>
Link: https://lore.kernel.org/r/20191003073049.3760-1-michael.vassernis@tandemg.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c

index 45c73a6f09a128a8ef069906b1e02aaf144ffaea..14f562cd715c0b8d27eb0fb21a08ccecbc416a01 100644 (file)
@@ -4026,7 +4026,7 @@ static int __init init_mac80211_hwsim(void)
        err = dev_alloc_name(hwsim_mon, hwsim_mon->name);
        if (err < 0) {
                rtnl_unlock();
-               goto out_free_radios;
+               goto out_free_mon;
        }
 
        err = register_netdevice(hwsim_mon);