Skip to content

Commit

Permalink
Staging: hv: check return value of osd_PageAlloc()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 75910f2 commit 7e052d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/hv/Channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7e052d9

Please sign in to comment.