Commit 330b5e80 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Greg Kroah-Hartman

staging: ozwpan: implement error handling in ozwpan_init()

Errors are correctly handled in oz_cdev_register() and oz_protocol_init(),
but then they are ignored in ozwpan_init().

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c181be7f
...@@ -34,11 +34,21 @@ MODULE_PARM_DESC(g_net_dev, "The device(s) to bind to; " ...@@ -34,11 +34,21 @@ MODULE_PARM_DESC(g_net_dev, "The device(s) to bind to; "
*/ */
static int __init ozwpan_init(void) static int __init ozwpan_init(void)
{ {
oz_cdev_register(); int err;
oz_protocol_init(g_net_dev);
err = oz_cdev_register();
if (err)
return err;
err = oz_protocol_init(g_net_dev);
if (err)
goto err_protocol;
oz_app_enable(OZ_APPID_USB, 1); oz_app_enable(OZ_APPID_USB, 1);
oz_apps_init(); oz_apps_init();
return 0; return 0;
err_protocol:
oz_cdev_deregister();
return err;
} }
/* /*
......
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