]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/siw: Fix a memory leak in siw_init_cpulist()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 9 Aug 2019 14:09:04 +0000 (17:09 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 12 Aug 2019 14:59:36 +0000 (10:59 -0400)
commit2a6f45ab2ee280d2999e817afa138f40f6279415
tree51a9ecba23f34cdde6b92de82410c1538a3bef44
parentff025d81d1568dfddcfb676dda877a76002dcbd9
RDMA/siw: Fix a memory leak in siw_init_cpulist()

The error handling code doesn't free siw_cpu_info.tx_valid_cpus[0].  The
first iteration through the loop is a no-op so this is sort of an off
by one bug.  Also Bernard pointed out that we can remove the NULL
assignment and simplify the code a bit.

Fixes: f8c4999b094d ("rdma/siw: network and RDMA core interface")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
Reviewed-by: Bernard Metzler <bmt@zurich.ibm.com>
Link: https://lore.kernel.org/r/20190809140904.GB3552@mwanda
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/siw/siw_main.c