Thread (1 message) 1 message, 1 author, 2016-08-03

Re: [PATCH] IB/hfi1: Handle kzalloc failure in init_pervl_scs

From: Doug Ledford <hidden>
Date: 2016-08-03 02:47:04

On Wed, 2016-07-27 at 21:06 -0400, ira.weiny wrote:
Checking the return value of the memory allocation call in
init_pervl_scs() was missed.  Recently the kmalloc() was changed to
kzalloc() which identified the problem.

While fixing this issue 2 other bugs were noticed.  First, the array
being allocated is accessed in the nomem path which can be reached
before
it is allocated.  Second, kernel_send_context was not released on
error.
Fix both of these by creating a more common memory unwind label
structure.

Fixes: 35f6befc8441 ("staging/rdma/hfi1: Add qp to send context
mapping for PIO")
Reported-by: Leon Romanovsky <redacted>
Reviewed-by: Mike Marciniszyn <redacted>
Signed-off-by: Dennis Dalessandro <redacted>
Signed-off-by: Ira Weiny <redacted>
---
 drivers/infiniband/hw/hfi1/pio.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
Thanks, applied.

-- 
Doug Ledford [off-list ref]
              GPG KeyID: 0E572FDD

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help