mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
mmc: sdhci: Check that ops are defined
The check is necessary to avoid NULL pointer dereference. Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
parent
ed52ea507f
commit
b70fe965bb
1 changed files with 2 additions and 2 deletions
|
@ -314,7 +314,7 @@ static int sdhci_execute_tuning(struct udevice *dev, uint opcode)
|
|||
|
||||
debug("%s\n", __func__);
|
||||
|
||||
if (host->ops->platform_execute_tuning) {
|
||||
if (host->ops && host->ops->platform_execute_tuning) {
|
||||
err = host->ops->platform_execute_tuning(mmc, opcode);
|
||||
if (err)
|
||||
return err;
|
||||
|
@ -347,7 +347,7 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock)
|
|||
if (clock == 0)
|
||||
return 0;
|
||||
|
||||
if (host->ops->set_delay)
|
||||
if (host->ops && host->ops->set_delay)
|
||||
host->ops->set_delay(host);
|
||||
|
||||
if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
|
||||
|
|
Loading…
Add table
Reference in a new issue