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

Skip to content
Commit c1e97551 authored by Subhash Jadavani's avatar Subhash Jadavani Committed by Xiaonian Wang
Browse files

mmc: host: sdhci-msm: fix NULL pointer dereference



We are seeing the kernel panic due to NULL pointer dereference with
following call trace:
	sdhci_msm_set_clock+0x59c/0xa28
	sdhci_do_set_ios+0xf4/0x740
	sdhci_set_ios+0x28/0x3c
	mmc_set_ios+0xac/0x1ec
	__mmc_set_clock+0x2c/0x3c
	mmc_ungate_clock+0x20/0x28
	mmc_host_clk_hold+0x54/0xc4
	mmc_power_off+0x1c/0x70
	mmc_rescan+0x250/0x27c
	process_one_work+0x240/0x420
	worker_thread+0x268/0x390
	kthread+0xf8/0x100

This is happending when eMMC initialization is failing in HS400 mode.
sdhci_msm_set_clock() might be accessing the card pointer after it
was deallocated, this change adds the safety checks to avoid NULL
dereference.

Change-Id: I895b8b33cce4173100d58acf690e57b5f4e69081
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent 8c0c937d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment