提交 d5531f37 编写于 作者: D Don Zickus 提交者: Greg Kroah-Hartman

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: NDon Zickus <dzickus@redhat.com>
Signed-off-by: NBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4f6d8a97
...@@ -62,6 +62,9 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes, ...@@ -62,6 +62,9 @@ visorchannel_create_guts(u64 physaddr, unsigned long channel_bytes,
int err; int err;
size_t size = sizeof(struct channel_header); size_t size = sizeof(struct channel_header);
if (physaddr == 0)
return NULL;
channel = kzalloc(sizeof(*channel), gfp); channel = kzalloc(sizeof(*channel), gfp);
if (!channel) if (!channel)
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册