Files
linux-stable-mirror/include/linux
Jorge Sanjuan Garcia a586742a37 mcb: remove is_added flag from mcb_device struct
commit 0f28ada1fb upstream.

When calling mcb_bus_add_devices(), both mcb devices and the mcb
bus will attempt to attach a device to a driver because they share
the same bus_type. This causes an issue when trying to cast the
container of the device to mcb_device struct using to_mcb_device(),
leading to a wrong cast when the mcb_bus is added. A crash occurs
when freing the ida resources as the bus numbering of mcb_bus gets
confused with the is_added flag on the mcb_device struct.

The only reason for this cast was to keep an is_added flag on the
mcb_device struct that does not seem necessary. The function
device_attach() handles already bound devices and the mcb subsystem
does nothing special with this is_added flag so remove it completely.

Fixes: 18d2881980 ("mcb: Correctly initialize the bus's device")
Cc: stable <stable@kernel.org>
Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@duagon.com>
Co-developed-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@duagon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@duagon.com>
Link: https://lore.kernel.org/r/20230906114901.63174-2-JoseJavier.Rodriguez@duagon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-19 23:05:36 +02:00
..
2023-07-23 13:46:54 +02:00
2023-08-11 15:13:51 +02:00
2022-08-17 14:23:11 +02:00
2022-10-26 12:35:12 +02:00
2022-08-31 17:16:34 +02:00
2023-10-10 21:59:06 +02:00
2023-03-30 12:47:50 +02:00
2023-08-30 16:18:19 +02:00
2022-10-26 12:35:26 +02:00
2022-08-17 14:24:08 +02:00
2022-07-12 16:35:08 +02:00
2023-08-03 10:22:30 +02:00
2023-06-21 15:59:15 +02:00
2023-08-26 14:23:39 +02:00
2023-03-17 08:49:02 +01:00
2022-07-02 16:41:17 +02:00
2023-08-03 10:22:26 +02:00
2023-10-19 23:05:33 +02:00
2023-10-19 23:05:33 +02:00
2022-07-12 16:35:08 +02:00
2022-07-29 17:25:32 +02:00
2022-09-15 11:30:05 +02:00