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: Don Zickus <dzickus@redhat.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Don Zickus 2015-05-13 13:22:21 -04:00 коммит произвёл Greg Kroah-Hartman
Родитель 4f6d8a9783
Коммит d5531f3701
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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;