[PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Hank Janssen
Correct issue with not checking kmalloc return value. This fix now only uses one receive buffer for all hv_utils channels, and will do only one kmalloc on init and will return with a -ENOMEM if kmalloc fails on initialize. Thanks to Evgeniy Polyakov z...@ioremap.net for pointing this out. And

Re: [PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Jesper Juhl
On Mon, 13 Dec 2010, Hank Janssen wrote: Correct issue with not checking kmalloc return value. This fix now only uses one receive buffer for all hv_utils channels, and will do only one kmalloc on init and will return with a -ENOMEM if kmalloc fails on initialize. Thanks to Evgeniy

RE: [PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Hank Janssen
-Original Message- From: Jesper Juhl [mailto:j...@chaosbits.net] Sent: Monday, December 13, 2010 12:48 PM You are leaking memory in the failure path. If for example one or two allocations succeed but one or two fail, then you'll leak the two successful allocations. I believe

RE: [PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Hank Janssen
-Original Message- From: Jesper Juhl [mailto:j...@chaosbits.net] Sent: Monday, December 13, 2010 1:06 PM On Mon, 13 Dec 2010, Hank Janssen wrote: ... Oops, you are correct. Resubmitting the patch in a few minutes. Ohh and another little detail; shouldn't this log message

RE: [PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Jesper Juhl
On Mon, 13 Dec 2010, Hank Janssen wrote: -Original Message- From: Jesper Juhl [mailto:j...@chaosbits.net] Sent: Monday, December 13, 2010 12:48 PM You are leaking memory in the failure path. If for example one or two allocations succeed but one or two fail, then you'll leak

Re: [PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Ky Srinivasan
On 12/13/2010 at 3:34 PM, in message 1292272498-29483-1-git-send-email-hjans...@microsoft.com, Hank Janssen hjans...@microsoft.com wrote: Correct issue with not checking kmalloc return value. This fix now only uses one receive buffer for all hv_utils channels, and will do only one kmalloc

Re: [PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Ky Srinivasan
On 12/13/2010 at 3:34 PM, in message 1292272498-29483-1-git-send-email-hjans...@microsoft.com, Hank Janssen hjans...@microsoft.com wrote: Correct issue with not checking kmalloc return value. This fix now only uses one receive buffer for all hv_utils channels, and will do only one kmalloc

RE: [PATCH 1/1] hv: Use only one receive buffer per channel and kmalloc on initialize

2010-12-13 Thread Hank Janssen
-Original Message- From: Jesper Juhl [mailto:j...@chaosbits.net] Sent: Monday, December 13, 2010 3:51 PM To: Ky Srinivasan + shut_txf_buf = kmalloc(PAGE_SIZE, GFP_ATOMIC); + time_txf_buf = kmalloc(PAGE_SIZE, GFP_ATOMIC); + hbeat_txf_buf = kmalloc(PAGE_SIZE, GFP_ATOMIC);