summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKaz Fukuoka <kfukuoka@nvidia.com>2011-05-25 14:40:53 -0700
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-27 15:41:50 -0700
commitdb1a22121d8fd3e48f1ba242b8419287c5c968f3 (patch)
tree228b7f02769cbdc1cbccd9017dec34d51ef7c06a /drivers
parentecff184b5594382c89798f6ffe8fb6dd1917f77c (diff)
media: tegra: avp: Avoid NULL reference in case of error
In case of avp_init() failure, NULL pointer was referenced, and caused kernel panic. bug 828027 Change-Id: I748f439b39db086be856bf4d6b2ec98c4ad3559a Reviewed-on: http://git-master/r/32141 Reviewed-by: Kaz Fukuoka <kfukuoka@nvidia.com> Tested-by: Kaz Fukuoka <kfukuoka@nvidia.com> Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/tegra/avp/avp.c3
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 db7410e41230..34f7ccdfcac4 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;
}