Skip to content

Commit

Permalink
s390/qeth: handle failure on workqueue creation
Browse files Browse the repository at this point in the history
Creating the global workqueue during driver init may fail, deal with it.
Also, destroy the created workqueue on any subsequent error.

Fixes: 0f54761 ("qeth: Support VEPA mode")
Signed-off-by: Julian Wiedmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
julianwiedmann authored and davem330 committed Apr 22, 2018
1 parent 901e3f4 commit a936b1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/s390/net/qeth_core_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6540,10 +6540,14 @@ static int __init qeth_core_init(void)
mutex_init(&qeth_mod_mutex);

qeth_wq = create_singlethread_workqueue("qeth_wq");
if (!qeth_wq) {
rc = -ENOMEM;
goto out_err;
}

rc = qeth_register_dbf_views();
if (rc)
goto out_err;
goto dbf_err;
qeth_core_root_dev = root_device_register("qeth");
rc = PTR_ERR_OR_ZERO(qeth_core_root_dev);
if (rc)
Expand Down Expand Up @@ -6580,6 +6584,8 @@ static int __init qeth_core_init(void)
root_device_unregister(qeth_core_root_dev);
register_err:
qeth_unregister_dbf_views();
dbf_err:
destroy_workqueue(qeth_wq);
out_err:
pr_err("Initializing the qeth device driver failed\n");
return rc;
Expand Down

0 comments on commit a936b1e

Please sign in to comment.