From: Bill Pemberton Date: Wed, 5 May 2010 19:27:30 +0000 (-0400) Subject: Staging: hv: check return value of osd_PageAlloc() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7e052d98f2bbcaaaa6d509081d78e600927cfe60;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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);