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

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

msm: kgsl: Get kgsl device from the hfi_start() caller



To avoid any kgsl device NULL pointer dereference in
hfi_start() get kgsl device from the hfi_start() caller.

Change-Id: I2c27067234d96097d0c894a3fb986afb20062b60
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 8ba63000
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1667,7 +1667,7 @@ static int gmu_start(struct kgsl_device *device)
		if (ret)
			goto error_gmu;

		ret = hfi_start(gmu, GMU_COLD_BOOT);
		ret = hfi_start(device, gmu, GMU_COLD_BOOT);
		if (ret)
			goto error_gmu;

@@ -1687,7 +1687,7 @@ static int gmu_start(struct kgsl_device *device)
		if (ret)
			goto error_gmu;

		ret = hfi_start(gmu, GMU_COLD_BOOT);
		ret = hfi_start(device, gmu, GMU_COLD_BOOT);
		if (ret)
			goto error_gmu;

@@ -1708,7 +1708,7 @@ static int gmu_start(struct kgsl_device *device)
				goto error_gmu;


			ret = hfi_start(gmu, GMU_COLD_BOOT);
			ret = hfi_start(device, gmu, GMU_COLD_BOOT);
			if (ret)
				goto error_gmu;

@@ -1724,7 +1724,7 @@ static int gmu_start(struct kgsl_device *device)
			if (ret)
				goto error_gmu;

			ret = hfi_start(gmu, GMU_COLD_BOOT);
			ret = hfi_start(device, gmu, GMU_COLD_BOOT);
			if (ret)
				goto error_gmu;
		}
+2 −2
Original line number Diff line number Diff line
@@ -601,9 +601,9 @@ static int hfi_verify_fw_version(struct kgsl_device *device,
	return 0;
}

int hfi_start(struct gmu_device *gmu, uint32_t boot_state)
int hfi_start(struct kgsl_device *device,
		struct gmu_device *gmu, uint32_t boot_state)
{
	struct kgsl_device *device = kgsl_get_device(KGSL_DEVICE_3D0);
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	int result;

+2 −1
Original line number Diff line number Diff line
@@ -613,7 +613,8 @@ struct kgsl_hfi {
struct gmu_device;
struct gmu_memdesc;

int hfi_start(struct gmu_device *gmu, uint32_t boot_state);
int hfi_start(struct kgsl_device *device, struct gmu_device *gmu,
		uint32_t boot_state);
void hfi_stop(struct gmu_device *gmu);
void hfi_receiver(unsigned long data);
void hfi_init(struct kgsl_hfi *hfi, struct gmu_memdesc *mem_addr,