Skip to content

Commit a936b1e

Browse files
julianwiedmanndavem330
authored andcommitted
s390/qeth: handle failure on workqueue creation
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]>
1 parent 901e3f4 commit a936b1e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/s390/net/qeth_core_main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6540,10 +6540,14 @@ static int __init qeth_core_init(void)
65406540
mutex_init(&qeth_mod_mutex);
65416541

65426542
qeth_wq = create_singlethread_workqueue("qeth_wq");
6543+
if (!qeth_wq) {
6544+
rc = -ENOMEM;
6545+
goto out_err;
6546+
}
65436547

65446548
rc = qeth_register_dbf_views();
65456549
if (rc)
6546-
goto out_err;
6550+
goto dbf_err;
65476551
qeth_core_root_dev = root_device_register("qeth");
65486552
rc = PTR_ERR_OR_ZERO(qeth_core_root_dev);
65496553
if (rc)
@@ -6580,6 +6584,8 @@ static int __init qeth_core_init(void)
65806584
root_device_unregister(qeth_core_root_dev);
65816585
register_err:
65826586
qeth_unregister_dbf_views();
6587+
dbf_err:
6588+
destroy_workqueue(qeth_wq);
65836589
out_err:
65846590
pr_err("Initializing the qeth device driver failed\n");
65856591
return rc;

0 commit comments

Comments
 (0)