[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>
Sat, 2 Aug 2025 13:13:02 +0000 (15:13 +0200)
commitd0a17bdc5ee039765964275741c8441054ac106b
tree771e892aefb5a809a90f94188d323d39416d39cf
parente44ed57596423a18a5e441c7894c9e8dff8c12cd
[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