[PATCH v3] net: mana: Fix possible double free in error handling path

2024-06-25 Thread Ma Ke
iary device") Signed-off-by: Ma Ke --- Changes in v3: - added a "Fixes" line as suggested. Changes in v2: - streamlined the patch according suggestions; - revised the description. --- drivers/net/ethernet/microsoft/mana/mana_en.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/

[PATCH v2] net: mana: Fix possible double free in error handling path

2024-06-25 Thread Ma Ke
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. Signed-off-by: Ma Ke --- Changes in v2: - streamlined the

[PATCH] net: mana: Fix possible double free in error handling path

2024-06-23 Thread Ma Ke
When auxiliary_device_add() returns error and then calls auxiliary_device_uninit(), callback function adev_release calls kfree(madev) to free memory. We shouldn't call kfree(padev) again in the error handling path. Signed-off-by: Ma Ke --- drivers/net/ethernet/microsoft/mana/mana_en.c