summaryrefslogtreecommitdiff
path: root/include/linux/device
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2026-04-30 12:17:18 +0300
committerDanilo Krummrich <dakr@kernel.org>2026-05-02 18:50:50 +0300
commit36f35b8df6972167102a1c3d4361e0afb6a84534 (patch)
treee24308619c2ea30e134489c93893d5a2f637e3ee /include/linux/device
parent1a262c768f5b5a1ebbdec8cfa588f75d3a825a8d (diff)
downloadlinux-36f35b8df6972167102a1c3d4361e0afb6a84534.tar.xz
driver core: reject devices with unregistered buses
Trying to register a device on a bus which has not yet been registered used to trigger a NULL-pointer dereference, but since the const bus structure rework registration instead succeeds without the device being added to the bus. This specifically means that the device will never bind to a driver and that the bus sysfs attributes are not created (i.e. as if the device had no bus). Reject devices with unregistered buses to catch any callers that get the ordering wrong and to handle bus registration failures more gracefully. Fixes: 5221b82d46f2 ("driver core: bus: bus_add/probe/remove_device() cleanups") Cc: stable@vger.kernel.org # 6.3 Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260430091718.230228-1-johan@kernel.org Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'include/linux/device')
0 files changed, 0 insertions, 0 deletions