Commit 0e02d10e authored by Martin Kaiser's avatar Martin Kaiser Committed by Greg Kroah-Hartman

staging: rtl8188eu: simplify rtl88eu_mon_init

The code looks a bit nicer without goto.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Link: https://lore.kernel.org/r/20210620175301.14988-9-martin@kaiser.cxSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 896e9022
......@@ -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;
return dev;
fail_free_dev:
if (err < 0) {
free_netdev(dev);
fail:
return NULL;
}
return dev;
}
void rtl88eu_mon_deinit(struct net_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment