Staging: hv: check return value of osd_PageAlloc()
authorBill Pemberton <wfp5p@virginia.edu>
Wed, 5 May 2010 19:27:30 +0000 (15:27 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 11 May 2010 18:36:12 +0000 (11:36 -0700)
The return value of osd_PageAlloc() was checked using an ASSERT().
Change that to more useful behaviour.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/hv/Channel.c

index de2ccb1082cec2fce333386e35db3dc6131d12c2..d939723db335f8a384e869c5b48f7e22e7d17e10 100644 (file)
@@ -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);