summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSunil Khatri <sunilkh@codeaurora.org>2016-04-29 09:16:27 -0600
committerJeevan Shriram <jshriram@codeaurora.org>2016-05-05 15:05:53 -0700
commitd051b709681cca557bc3970dfa66fea184e1fc7c (patch)
tree50ec90748368f762430ca913c631a8b299ef68f9 /drivers
parent9a313755d210eb5d77638d321b4e607da73093b1 (diff)
msm: kgsl: Check for failure in coresight initialization
We need to check for both NULL pointer and error condition in coresight initialization and return with proper error. CR's-Fixed: 971398 Change-Id: Id1e3e0f756ac1c9a0ff4f4e6ce073e80e31473b8 Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/msm/adreno_coresight.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/msm/adreno_coresight.c b/drivers/gpu/msm/adreno_coresight.c
index 9825797039cc..02a39278ccb3 100644
--- a/drivers/gpu/msm/adreno_coresight.c
+++ b/drivers/gpu/msm/adreno_coresight.c
@@ -313,8 +313,9 @@ int adreno_coresight_init(struct adreno_device *adreno_dev)
desc.pdata = of_get_coresight_platform_data(&device->pdev->dev,
device->pdev->dev.of_node);
- if (desc.pdata == NULL)
- return -ENODEV;
+ if (IS_ERR_OR_NULL(desc.pdata))
+ return (desc.pdata == NULL) ? -ENODEV :
+ PTR_ERR(desc.pdata);
desc.type = CORESIGHT_DEV_TYPE_SOURCE;
desc.subtype.source_subtype = CORESIGHT_DEV_SUBTYPE_SOURCE_BUS;