diff options
author | Kaz Fukuoka <kfukuoka@nvidia.com> | 2011-05-25 14:40:53 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2012-03-23 00:41:08 -0700 |
commit | 0fe50e5f8cb34a04a983c1a63a9f0787123bb5cd (patch) | |
tree | 3a72788e7fbdfde6a8a603f6288f43ba0ee4bf5a /drivers/media/video/tegra/avp | |
parent | dce3196f813f551098529937413714e5fd85aa3d (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
Original-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>
Rebase-Id: R8703137ddec05ddec4a5ecb1b24ad6bf893e1f88
Diffstat (limited to 'drivers/media/video/tegra/avp')
-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; } |