]> git.baikalelectronics.ru Git - kernel.git/commit
net: mana: Fix memory leak in mana_hwc_create_wq
authorJosé Expósito <jose.exposito89@gmail.com>
Wed, 8 Dec 2021 22:37:23 +0000 (23:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 Dec 2021 15:58:41 +0000 (07:58 -0800)
commitb5c4c2c255c02eb7e84e962aca3e11711c8f0f62
treeeb9e6e7176772763355d37f1176e932500b1af00
parent2d4884c9acc6a4478473fe5e65e9fd5f02b1dc2c
net: mana: Fix memory leak in mana_hwc_create_wq

If allocating the DMA buffer fails, mana_hwc_destroy_wq was called
without previously storing the pointer to the queue.

In order to avoid leaking the pointer to the queue, store it as soon as
it is allocated.

Addresses-Coverity-ID: 1484720 ("Resource leak")
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/r/20211208223723.18520-1-jose.exposito89@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/microsoft/mana/hw_channel.c