tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ehci: fix error handling?



On Sat, 25 May 2019, Maxime Villard wrote:

> To fix this problem, we need to fix the error handling in ehci_pci_attach(),
> so that goto fail does not leave 'sc' in an inconsistent state.
> 
> What is the best way to do that? Should I somehow forcibly unregister the
> device, or should I add a flag in 'sc' to indicate whether it is initialized?

the latter

> It looks like there is no clean way to handle attach failures.

attach always 'succeeds' in the sense that after attach has been called, 
detach will always be called. The detach routine should tear down 
everything that needs tearing down and not do things that will fail. 
Perhaps the init could simply be done before the attach routine gets the 
chance to fail?

iain


Home | Main Index | Thread Index | Old Index