Message ID | 20241219192733.45659-3-hdegoede@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/4] media: hi556: Fix memory leak (on error) in hi556_check_hwcfg() | expand |
diff --git a/drivers/media/i2c/hi556.c b/drivers/media/i2c/hi556.c index 960d6c2d3d93..57c51d0e9c4e 100644 --- a/drivers/media/i2c/hi556.c +++ b/drivers/media/i2c/hi556.c @@ -1220,7 +1220,8 @@ static int hi556_check_hwcfg(struct device *dev) */ ep = fwnode_graph_get_next_endpoint(fwnode, NULL); if (!ep) - return -EPROBE_DEFER; + return dev_err_probe(dev, -EPROBE_DEFER, + "waiting for fwnode graph endpoint\n"); ret = v4l2_fwnode_endpoint_alloc_parse(ep, &bus_cfg); fwnode_handle_put(ep);
The hi556 driver waits for the endpoint fwnode to show up in case this fwnode is created by a bridge-driver. It does this by returning -EPROBE_DEFER, but it does not use dev_err_probe() so no reason for deferring gets registered. After 30 seconds the kernel logs a warning that the probe is still deferred, which looks like this: [ 33.952052] i2c i2c-INT3537:00: deferred probe pending: (reason unknown) Use dev_err_probe() when returning -EPROBE_DEFER to register the probe deferral reason changing the error to: deferred probe pending: waiting for fwnode graph endpoint Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/media/i2c/hi556.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)