From 0c9ebea187895c1a9f059c7f9dc01aa30e846296 Mon Sep 17 00:00:00 2001 From: Mariusz Glebocki Date: Tue, 10 Feb 2015 10:51:02 +0100 Subject: Prevent null pointer dereference --- drivers/video/tegra/nvmap/nvmap_handle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/video') 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); -- cgit v1.2.3