summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Zickus <dzickus@redhat.com>2015-05-13 13:22:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 13:28:56 -0700
commitd5531f3701d7e1b1bef5f8a567d4ed6175f78202 (patch)
tree870d77be3c38e312833f8d9a961aa28e7f6bd491
parent4f6d8a97833f4640991f696d471486e5442eb0b2 (diff)
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>
-rw-r--r--drivers/staging/unisys/visorbus/visorchannel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/unisys/visorbus/visorchannel.c b/drivers/staging/unisys/visorbus/visorchannel.c
index 1789f9d89c0d..6e7675e27b21 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -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;