Re: [Qemu-devel] [PATCH v2] hw: pvrdma: fix memory leak in error path

2019-01-09 Thread Yuval Shaia
On Tue, Jan 08, 2019 at 07:02:28AM -0800, Li Qiang wrote: > Currently, pvrdma_qp_send() function leak the 'comp_ctx', > Since 'comp_ctx' is used after the two checks, just relocate > the allocation & initialization after the two check. > > Spotted by Coverity: CID 1398595 > > Fixes: 2b05705dc8 >

Re: [Qemu-devel] [PATCH v2] hw: pvrdma: fix memory leak in error path

2019-01-08 Thread Philippe Mathieu-Daudé
On 1/8/19 4:02 PM, Li Qiang wrote: > Currently, pvrdma_qp_send() function leak the 'comp_ctx', > Since 'comp_ctx' is used after the two checks, just relocate > the allocation & initialization after the two check. > > Spotted by Coverity: CID 1398595 > > Fixes: 2b05705dc8 Suggested-by: Yuval Shai

[Qemu-devel] [PATCH v2] hw: pvrdma: fix memory leak in error path

2019-01-08 Thread Li Qiang
Currently, pvrdma_qp_send() function leak the 'comp_ctx', Since 'comp_ctx' is used after the two checks, just relocate the allocation & initialization after the two check. Spotted by Coverity: CID 1398595 Fixes: 2b05705dc8 Signed-off-by: Li Qiang --- hw/rdma/vmw/pvrdma_qp_ops.c | 16 ---