提交 3e67dee2 编写于 作者: R Richard Weinberger 提交者: Greg Kroah-Hartman

staging/xillybus: Handle OOM in xillybus_init()

alloc_workqueue() can fail and returns NULL in case of
OOM.
Handle this case and undo class_create().
Signed-off-by: NRichard Weinberger <richard@nod.at>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 b5f87cf9
......@@ -2318,8 +2318,12 @@ static int __init xillybus_init(void)
}
xillybus_wq = alloc_workqueue(xillyname, 0, 0);
if (!xillybus_wq) {
class_destroy(xillybus_class);
rc = -ENOMEM;
}
return 0; /* Success */
return rc;
}
static void __exit xillybus_exit(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册