On 15 March 2016 at 20:28, Thomas Hanson <thomas.han...@linaro.org> wrote: > The patch looks good. > > Would it also be good to update bus_add_child() so that it NULL-checks > its "bus" parameter before dereferencing it?
No, I think it's just a programming error to call qdev_set_parent_bus() with a NULL bus parameter, so crashing is fine. (The problem fixed by this patch doesn't involve calling bus_add_child() with a NULL pointer, in any case -- qdev_try_create() will handle a NULL bus pointer as "use the default system bus", so by the time it gets to bus_add_child() the bus pointer is never NULL. It's using the default bus at all that causes things to go wrong much later on down the line.) thanks -- PMM