Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mcb: fix error handling in mcb_alloc_bus()
There are two bugs: 1) If ida_simple_get() fails then this code calls put_device(carrier) but we haven't yet called get_device(carrier) and probably that leads to a use after free. 2) After device_initialize() then we need to use put_device() to release the bus. This will free the internal resources tied to the device and call mcb_free_bus() which will free the rest. Fixes: 5d9e2ab ("mcb: Implement bus->dev.release callback") Fixes: 18d2881 ("mcb: Correctly initialize the bus's device") Cc: [email protected] Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/32e160cf6864ce77f9d62948338e24db9fd8ead9.1630931319.git.johannes.thumshirn@wdc.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information