[PATCH 35/44] net: mana: Fix possible double free in error handling path
authorMa Ke <make24@iscas.ac.cn>
Tue, 25 Jun 2024 13:03:14 +0000 (21:03 +0800)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 22 May 2025 18:32:07 +0000 (20:32 +0200)
commitc596f82a8819170e3920ba6ecf932c015d872cac
tree1cb2648f79167935bac778590c142c0375439844
parenta3f354e9f9a29073c33f5e2236a1061a2e1f421c
[PATCH 35/44] net: mana: Fix possible double free in error handling path

When auxiliary_device_add() returns error and then calls
auxiliary_device_uninit(), callback function adev_release
calls kfree(madev). We shouldn't call kfree(madev) again
in the error handling path. Set 'madev' to NULL.

Fixes: a69839d4327d ("net: mana: Add support for auxiliary device")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Link: https://patch.msgid.link/20240625130314.2661257-1-make24@iscas.ac.cn
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
(cherry picked from commit 1864b8224195d0e43ddb92a8151f54f6562090cc)
Signed-off-by: Bastian Blank <waldi@debian.org>
Gbp-Pq: Topic features/all/ethernet-microsoft
Gbp-Pq: Name 0035-net-mana-Fix-possible-double-free-in-error-handling-.patch
drivers/net/ethernet/microsoft/mana/mana_en.c