Skip to content
Commit 3922bebc authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by naushir
Browse files

media: rp1: cfe: Fix use of freed memory on errors



cfe_probe_complete() calls cfe_put() on both success and fail code paths.
This works for the success path, but causes the cfe_device struct to be
freed, even if it will be used later in the teardown code.

Fix this by making the ref handling a bit saner: Let the video nodes
have the refs as they do now, but also keep a ref in the "main" driver,
released only at cfe_remove() time. This way the driver does not depend
on the video nodes keeping the refs.

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
parent a1caea3c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment