Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3e67dee2 authored by Richard Weinberger's avatar Richard Weinberger Committed by Greg Kroah-Hartman
Browse files

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: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b5f87cf9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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)