From: Bill Pemberton <[email protected]>

The return value of osd_PageAlloc() was checked using an ASSERT().
Change that to more useful behaviour.

Signed-off-by: Bill Pemberton <[email protected]>
Cc: Hank Janssen <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/hv/Channel.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index de2ccb1..d939723 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);
-- 
1.7.0.3

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to