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

Commit d5531f37 authored by Don Zickus's avatar Don Zickus Committed by Greg Kroah-Hartman
Browse files

staging: unisys: Add checks for creation



There was a bunch of channel creation checks before the
visorchannel_create function was called, moving some of those
checks inside.  This keeps the outside code cleaner and handles
the situation where a caller forgets to make these checks.

Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4f6d8a97
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
	int err;
	size_t size = sizeof(struct channel_header);

	if (physaddr == 0)
		return NULL;

	channel = kzalloc(sizeof(*channel), gfp);
	if (!channel)
		goto cleanup;