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

Commit e1fac91a authored by Carter Cooper's avatar Carter Cooper
Browse files

msm: kgsl: Release firmware if allocating GPU space fails at init



Clean up what we've already done if we fail to allocate GPU
space for the firmware.

Change-Id: I64e3974e337d02a64e353bef0d8705447ea1665f
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent d2077209
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1868,19 +1868,20 @@ static int _load_firmware(struct adreno_device *adreno_dev, const char *fwfile,
		return ret;
	}

	ret = kgsl_allocate_global(device, ucode, fw->size,
	ret = kgsl_allocate_global(device, ucode, fw->size - 4,
				KGSL_MEMFLAGS_GPUREADONLY, 0);

	if (ret)
		return ret;
		goto done;

	memcpy(ucode->hostptr, &fw->data[4], fw->size - 4);
	*ucode_size = (fw->size - 4) / sizeof(uint32_t);
	*ucode_version = *(unsigned int *)&fw->data[4];

done:
	release_firmware(fw);

	return 0;
	return ret;
}

/*