summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_iommu.c
diff options
context:
space:
mode:
authorSuprith Malligere Shankaregowda <supgow@codeaurora.org>2018-04-04 17:58:29 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-04-09 05:40:01 -0700
commit8604e9806fd8feac2b9caa8bfa98c06c73654429 (patch)
treec5348ad8fdbbe62e646fedbe1dc172af5085fb2f /drivers/gpu/drm/msm/msm_iommu.c
parentef00227cce638b1ca8bd8c04d342a8688b7400e9 (diff)
drm: msm: fix potential NULL pointer dereference
adding NULL check before dereferencing a pointer. Change-Id: I260b016abdcb16f5b16e58671ed208df21c99a46 Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_iommu.c')
-rw-r--r--drivers/gpu/drm/msm/msm_iommu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c
index b52c4752c5fe..4586b62401fb 100644
--- a/drivers/gpu/drm/msm/msm_iommu.c
+++ b/drivers/gpu/drm/msm/msm_iommu.c
@@ -237,7 +237,8 @@ static struct device *find_context_bank(const char *name)
/* Get the parent device */
parent = of_find_device_by_node(node->parent);
-
+ if (!parent)
+ return ERR_PTR(-ENODEV);
/* Populate the sub nodes */
of_platform_populate(parent->dev.of_node, NULL, NULL, &parent->dev);