Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b8311c7b authored by Sunil Khatri's avatar Sunil Khatri
Browse files

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: default avatarSunil Khatri <sunilkh@codeaurora.org>
parent 184e2ced
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
/* Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -314,8 +314,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;