Skip to content
Snippets Groups Projects
Commit 5be4bc1c authored by Zijun Hu's avatar Zijun Hu Committed by Greg Kroah-Hartman
Browse files

driver core: bus: Fix double free in driver API bus_register()


commit bfa54a79 upstream.

For bus_register(), any error which happens after kset_register() will
cause that @priv are freed twice, fixed by setting @priv with NULL after
the first free.

Signed-off-by: default avatarZijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20240727-bus_register_fix-v1-1-fed8dd0dba7a@quicinc.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
[ Brennan : Backport requires bus->p = NULL instead of priv = NULL ]
Signed-off-by: default avatarBrennan Lamoreaux <brennan.lamoreaux@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e844bcca
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment