Skip to content
Commit ba18dedd authored by Yongzhi Liu's avatar Yongzhi Liu Committed by Paolo Abeni
Browse files

net: pds_core: Fix possible double free in error handling path

When auxiliary_device_add() returns error and then calls
auxiliary_device_uninit(), Callback function pdsc_auxbus_dev_release
calls kfree(padev) to free memory. We shouldn't call kfree(padev)
again in the error handling path.

Fix this by cleaning up the redundant kfree() and putting
the error handling back to where the errors happened.

Fixes: 4569cce4

 ("pds_core: add auxiliary_bus devices")
Signed-off-by: default avatarYongzhi Liu <hyperlyzcs@gmail.com>
Reviewed-by: default avatarWojciech Drewek <wojciech.drewek@intel.com>
Reviewed-by: default avatarShannon Nelson <shannon.nelson@amd.com>
Link: https://lore.kernel.org/r/20240306105714.20597-1-hyperlyzcs@gmail.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d5b8aff7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment