diff options
author | Gary King <gking@nvidia.com> | 2010-10-11 14:22:35 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:36:06 -0800 |
commit | ce4d7af217206130890970dfa4e1051a48fb9d13 (patch) | |
tree | 9deaa657b83ac082fb252264bcfbc30c599b26b9 /drivers/video/tegra/nvmap/nvmap_dev.c | |
parent | a15f96ec6de6c511fc2183a81a6fba67fc034ddc (diff) |
video: tegra: nvmap: fix read failures, super user and noref pinning
a >= vs > error when checking the operating region of the read and
write ioctls was causing failures when reading the last byte of a handle.
the super-user node (knvmap) wasn't registered correctly due to a cut-
and-paste error, and the regular user node was assigned super-user
priveleges.
noref pinning wasn't correctly validating that the specified handle
existed before pinning it, which caused the reference count for the
handle to become imbalanced on a subsequent unpin
Change-Id: I9985b85023705b00389a53fb962c3b60d62da6b8
Signed-off-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/nvmap/nvmap_dev.c')
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_dev.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c index b84a788dd33b..c6669ed86c24 100644 --- a/drivers/video/tegra/nvmap/nvmap_dev.c +++ b/drivers/video/tegra/nvmap/nvmap_dev.c @@ -353,6 +353,8 @@ struct nvmap_handle *nvmap_validate_get(struct nvmap_client *client, if ((unsigned long)h == id) { if (client->super || h->global || (h->owner == client)) h = nvmap_handle_get(h); + else + h = NULL; spin_unlock(&client->dev->handle_lock); return h; } @@ -696,9 +698,9 @@ static int nvmap_probe(struct platform_device *pdev) dev->dev_user.parent = &pdev->dev; dev->dev_super.minor = MISC_DYNAMIC_MINOR; - dev->dev_super.name = "kvmap"; - dev->dev_user.fops = &nvmap_super_fops; - dev->dev_user.parent = &pdev->dev; + dev->dev_super.name = "knvmap"; + dev->dev_super.fops = &nvmap_super_fops; + dev->dev_super.parent = &pdev->dev; dev->handles = RB_ROOT; |