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

Commit bccd0761 authored by Hareesh Gundu's avatar Hareesh Gundu
Browse files

msm: kgsl: Fix gpudev NULL dereference in adreno_remove



In adreno_remove() there is possibility of dereference of gpudev
without NULL check. Fix this by getting gpudev after adreno_dev
NULL check.

CRs-Fixed: 993267
Change-Id: I17d8b4ba2c74a787a065dbdb0ac88d065605fcb1
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 60d40c19
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1013,13 +1013,14 @@ static void _adreno_free_memories(struct adreno_device *adreno_dev)
static int adreno_remove(struct platform_device *pdev)
{
	struct adreno_device *adreno_dev = adreno_get_dev(pdev);
	struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev);
	struct adreno_gpudev *gpudev;
	struct kgsl_device *device;

	if (adreno_dev == NULL)
		return 0;

	device = KGSL_DEVICE(adreno_dev);
	gpudev = ADRENO_GPU_DEVICE(adreno_dev);

	if (gpudev->remove != NULL)
		gpudev->remove(adreno_dev);