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>
This commit is contained in:
Sunil Khatri 2016-04-29 09:16:27 -06:00 committed by Jeevan Shriram
parent 9a313755d2
commit d051b70968

View file

@ -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;