diff options
author | Mariusz Glebocki <mglb@arccos-1.net> | 2015-02-10 10:51:02 +0100 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2015-02-10 14:45:35 +0100 |
commit | 0c9ebea187895c1a9f059c7f9dc01aa30e846296 (patch) | |
tree | 5aea45b5fc451f43d9a5a189830993a2787f5942 | |
parent | 2e26dfce64a4d12b47c36bb49adbd30575bffe36 (diff) |
Prevent null pointer dereference
-rw-r--r-- | drivers/video/tegra/nvmap/nvmap_handle.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c index d1d5f267f5c5..1e0ce2c59c17 100644 --- a/drivers/video/tegra/nvmap/nvmap_handle.c +++ b/drivers/video/tegra/nvmap/nvmap_handle.c @@ -994,8 +994,9 @@ struct nvmap_handle_ref *nvmap_duplicate_handle_id(struct nvmap_client *client, clients only if the owner is "videobuf2-dma-nvmap which is a V4L2 capture kernel module. This handle can be accessed by the "user" client for rendering/encoding */ - if (!strcmp(((struct nvmap_handle *)id)->owner->name, - "videobuf2-dma-nvmap")) + if (id && ((struct nvmap_handle *)id)->owner && + !strcmp(((struct nvmap_handle *)id)->owner->name, + "videobuf2-dma-nvmap")) client = ((struct nvmap_handle *)id)->owner; h = nvmap_validate_get(client, id); |