staging: rtl8188eu: simplify rtl88eu_mon_init
authorMartin Kaiser <martin@kaiser.cx>
Sun, 20 Jun 2021 17:52:57 +0000 (19:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jun 2021 12:42:45 +0000 (14:42 +0200)
The code looks a bit nicer without goto.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-9-martin@kaiser.cx
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/os_dep/mon.c

index 9b40de7..6370a3d 100644 (file)
@@ -163,18 +163,15 @@ struct net_device *rtl88eu_mon_init(void)
 
        dev = alloc_netdev(0, "mon%d", NET_NAME_UNKNOWN, mon_setup);
        if (!dev)
-               goto fail;
+               return NULL;
 
        err = register_netdev(dev);
-       if (err < 0)
-               goto fail_free_dev;
+       if (err < 0) {
+               free_netdev(dev);
+               return NULL;
+       }
 
        return dev;
-
-fail_free_dev:
-       free_netdev(dev);
-fail:
-       return NULL;
 }
 
 void rtl88eu_mon_deinit(struct net_device *dev)