Hi!
Is devm_ supposed to work with EPROBE_DEFFER?
Probe function is now called multiple times; is memory freed between
calling probe()? Will allocations from failed probe()s remain after
the driver is inserted successfully, leaking memory?
Thanks,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Hi,
On Fri, May 31, 2019 at 10:52:10AM +0200, Pavel Machek wrote:
> Is devm_ supposed to work with EPROBE_DEFFER?
Sure.
> Probe function is now called multiple times;
> is memory freed between calling probe()?
Yes, EPROBE_DEFER is an error code, so devm resources
are released.
> Will allocations from failed probe()s remain after the driver is
> inserted successfully, leaking memory?
devm_ is connected to the device, not to the driver.
Since code is better than words, check drivers/base/dd.c yourself.
The relevant function name is really_probe(), interesting part for
you starts at ret = drv->probe(dev) line.
-- Sebastian