Re: [PATCH] driver core: reject devices with unregistered buses

From: Danilo Krummrich

Date: Tue Apr 28 2026 - 15:09:11 EST


On Mon Apr 27, 2026 at 12:28 PM CEST, Johan Hovold wrote:
> 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.
>
> 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@xxxxxxxxxxxxxxx # 6.3

Hm...this sounds like hardening and not like a "real" bug fix. Do you have a
specific reason why you added Cc: stable?