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

Commit d706b83e authored by Aravind Kumar's avatar Aravind Kumar Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm8x16: avoid access of invalid memory



If ioremap fails, the current code goes ahead and
tries to access that remapped address causing a crash.
Return immediately upon ioremap failure.

CRs-Fixed: 747347
Change-Id: I0794e0cea56daa220438a7863125d0bca2be66c2
Signed-off-by: default avatarAravind Kumar <akumark@codeaurora.org>
parent f9b9647b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -818,16 +818,20 @@ static int msm8939_gpio_set_mux_ctl(void)
	iounmap(vaddr);

	vaddr = ioremap(0x103f004, 4);
	if (!vaddr)
	if (!vaddr) {
		pr_err("%s ioremap failure for addr\n",
					__func__);
		return -ENOMEM;
	}
	val = ioread32(vaddr);
	pr_debug("%s:val1 %x\n", __func__, val);
	iounmap(vaddr);
	vaddr = ioremap(0x103f000, 4);
	if (!vaddr)
	if (!vaddr) {
		pr_err("%s ioremap failure for addr2\n",
					__func__);
		return -ENOMEM;
	}
	val = ioread32(vaddr);
	pr_debug("%s:val2 %x\n", __func__, val);
	iounmap(vaddr);