@@ -78,6 +78,7 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier,
bool asd_fwnode_is_ep;
bool sd_fwnode_is_ep;
struct device *dev;
+ bool match;
/*
* Both the subdev and the async subdev can provide either an endpoint
@@ -113,9 +114,10 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier,
other_fwnode = sd->fwnode;
}
- fwnode_handle_put(dev_fwnode);
+ match = (dev_fwnode == other_fwnode);
- if (dev_fwnode != other_fwnode)
+ fwnode_handle_put(dev_fwnode);
+ if (!match)
return false;
/*
fwnode_handle_put() should be called after the fwnode is last accessed. Fix it. Fixes: b98158d837ef ("media: v4l2-async: Accept endpoints and devices for fwnode matching") Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> --- drivers/media/v4l2-core/v4l2-async.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)