From 7e052d98f2bbcaaaa6d509081d78e600927cfe60 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Wed, 5 May 2010 15:27:30 -0400 Subject: [PATCH] Staging: hv: check return value of osd_PageAlloc() The return value of osd_PageAlloc() was checked using an ASSERT(). Change that to more useful behaviour. Signed-off-by: Bill Pemberton Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- drivers/staging/hv/Channel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c index de2ccb1082ce..d939723db335 100644 --- a/drivers/staging/hv/Channel.c +++ b/drivers/staging/hv/Channel.c @@ -192,7 +192,9 @@ int VmbusChannelOpen(struct vmbus_channel *NewChannel, u32 SendRingBufferSize, /* Allocate the ring buffer */ out = osd_PageAlloc((SendRingBufferSize + RecvRingBufferSize) >> PAGE_SHIFT); - ASSERT(out); + if (!out) + return -ENOMEM; + ASSERT(((unsigned long)out & (PAGE_SIZE-1)) == 0); in = (void *)((unsigned long)out + SendRingBufferSize); -- GitLab