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

Commit 2b344102 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: pil: Avoid possible buffer overflow"

parents e0895078 45181714
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -534,7 +534,7 @@ int pil_mss_reset_load_mba(struct pil_desc *pil)
	char *fw_name_p;
	void *mba_dp_virt;
	dma_addr_t mba_dp_phys, mba_dp_phys_end;
	int ret, count;
	int ret;
	const u8 *data;
	struct device *dma_dev = md->mba_mem_dev_fixed ?: &md->mba_mem_dev;

@@ -595,10 +595,9 @@ int pil_mss_reset_load_mba(struct pil_desc *pil)
			&mba_dp_phys, &mba_dp_phys_end, drv->mba_dp_size);

	/* Load the MBA image into memory */
	count = fw->size;
	if (count <= SZ_1M) {
	if (fw->size <= SZ_1M) {
		/* Ensures memcpy is done for max 1MB fw size */
		memcpy(mba_dp_virt, data, count);
		memcpy(mba_dp_virt, data, fw->size);
	} else {
		dev_err(pil->dev, "%s fw image loading into memory is failed due to fw size overflow\n",
			__func__);