[PATCH 09/13] staging: rtl8188eu: simplify rtl88eu_mon_init

From: Martin Kaiser
Date: Sun Jun 20 2021 - 13:54:37 EST


The code looks a bit nicer without goto.

Signed-off-by: Martin Kaiser <martin@xxxxxxxxx>
---
drivers/staging/rtl8188eu/os_dep/mon.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/mon.c b/drivers/staging/rtl8188eu/os_dep/mon.c
index 9b40de7d39e7..6370a3d8881b 100644
--- a/drivers/staging/rtl8188eu/os_dep/mon.c
+++ b/drivers/staging/rtl8188eu/os_dep/mon.c
@@ -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)
--
2.20.1