]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx4: Optimize freeing of items on error unwind
authorManinder Singh <maninder1.s@samsung.com>
Wed, 8 Jul 2015 04:13:35 +0000 (09:43 +0530)
committerDoug Ledford <dledford@redhat.com>
Tue, 14 Jul 2015 17:20:14 +0000 (13:20 -0400)
commitbaf9a07ba69d249130e75322a5dc407c4376ad74
treea863a36fb8f1a4f0a769d5a72dc781468d3bc9ad
parent2ea39575f37885c23ef95e4d980f2e96303bc0d5
IB/mlx4: Optimize freeing of items on error unwind

On failure, we loop through all possible pointers and test them before
calling kfree.  But really, why even attempt to free items we didn't
allocate when we can easily loop through exactly and only the devices
for which the original memory allocation succeeded and free just those.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx4/main.c