diff options
-rw-r--r-- | drivers/media/video/tegra/avp/avp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/tegra/avp/avp.c b/drivers/media/video/tegra/avp/avp.c index 6526ac4699c9..2feb2b3b3427 100644 --- a/drivers/media/video/tegra/avp/avp.c +++ b/drivers/media/video/tegra/avp/avp.c @@ -1387,14 +1387,15 @@ int tegra_avp_open(struct tegra_avp_info **avp) ret = avp_init(new_avp); if (ret < 0) { + mutex_unlock(&new_avp->open_lock); new_avp = 0; goto out; } new_avp->refcount++; -out: mutex_unlock(&new_avp->open_lock); +out: *avp = new_avp; return ret; } |