mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Subsystems (4)
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Commit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field.
--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/atmel_sdhci.c +2 -2
@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice *dev)return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,0 ,ATMEL_SDHC_MIN_FREQ );if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
Signature · 1 line
2.16.4
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Quoted 23 lines
Subject: [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeCommit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Wenyou Yang <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/atmel_sdhci.c index renamed from drivers/mmc/atmel_sdhci.c +0
-0
4be47ba75e..d930ed8da0100644drivers/mmc/atmel_sdhci.c +1
-0@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice *dev)return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc;
drivers/mmc/atmel_sdhci.c static int atmel_sdhci_probe(struct udevice *dev) · line 99
Quoted 10 lines
drivers/mmc/atmel_sdhci.c +1
-2+ host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,0 ,ATMEL_SDHC_MIN_FREQ );if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
Patchset applied to mmc/master.
Thanks,
Peng.
Quoted 3 lines
drivers/mmc/atmel_sdhci.c +0
-1--2.16.4
PATCH 2/7 mmc: bcm: fix uninitialized pointer deref on probe
In reply to Peng FanCommit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field.
--- drivers/mmc/bcm2835_sdhci.c | 4 +++- drivers/mmc/bcmstb_sdhci.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/mmc/bcm2835_sdhci.c +3 -1
@@ -214,6 +214,9 @@ static int bcm2835_sdhci_probe(struct udevice *dev) host->voltages =MMC_VDD_32_33 |MMC_VDD_33_34 |MMC_VDD_165_195 ; host->ops = &bcm2835_ops; + host->mmc = &plat->mmc; + host->mmc->dev = dev; + ret =sdhci_setup_cfg (&plat->cfg, host, emmc_freq,MIN_FREQ );if (ret) {debug ("%s: Failed to setup SDHCI (err=%d)\n" , __func__, ret);
@@ -221,7 +224,6 @@ static int bcm2835_sdhci_probe(struct udevice *dev) } upriv->mmc = &plat->mmc; - host->mmc = &plat->mmc; host->mmc->priv = host;return sdhci_probe (dev);
drivers/mmc/bcmstb_sdhci.c +2 -1
@@ -73,6 +73,8 @@ static int sdhci_bcmstb_probe(struct udevice *dev)if (ret)return ret; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,BCMSTB_SDHCI_MAXIMUM_CLOCK_FREQUENCY ,BCMSTB_SDHCI_MINIMUM_CLOCK_FREQUENCY );
@@ -80,7 +82,6 @@ static int sdhci_bcmstb_probe(struct udevice *dev)return ret; upriv->mmc = &plat->mmc; - host->mmc = &plat->mmc; host->mmc->priv = host;return sdhci_probe (dev);
Signature · 1 line
2.16.4
PATCH 3/7 mmc: msm_sdhci: fix uninitialized pointer deref on probe
In reply to Peng FanCommit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field.
--- drivers/mmc/msm_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/msm_sdhci.c +2 -2
@@ -141,12 +141,12 @@ static int msm_sdc_probe(struct udevice *dev)writel (caps, host->ioaddr +SDHCI_VENDOR_SPEC_CAPABILITIES0 ); } - ret =sdhci_setup_cfg (&plat->cfg, host,0 ,0 ); host->mmc = &plat->mmc; + host->mmc->dev = dev; + ret =sdhci_setup_cfg (&plat->cfg, host,0 ,0 );if (ret)return ret; host->mmc->priv = &prv->host; - host->mmc->dev = dev; upriv->mmc = host->mmc;return sdhci_probe (dev);
Signature · 1 line
2.16.4
PATCH 4/7 mmc: pci: fix uninitialized pointer deref on probe
In reply to Peng FanCommit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field.
--- drivers/mmc/pci_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/pci_mmc.c +2 -2
@@ -33,12 +33,12 @@ static int pci_mmc_probe(struct udevice *dev) host->ioaddr = (void *)dm_pci_map_bar (dev,PCI_BASE_ADDRESS_0 ,PCI_REGION_MEM ); host->name = dev->name; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,0 ,0 );if (ret)return ret; - host->mmc = &plat->mmc; host->mmc->priv = &priv->host; - host->mmc->dev = dev; upriv->mmc = host->mmc;return sdhci_probe (dev);
Signature · 1 line
2.16.4
PATCH 4/7 mmc: pci: fix uninitialized pointer deref on probe
Quoted 5 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.
Quoted 8 lines
Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Simon Glass <[email protected]>Cc Bin Meng <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/pci_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/pci_mmc.c static int pci_mmc_probe(struct udevice *dev) · line 37
Quoted 11 lines
drivers/mmc/pci_mmc.c +2
-0@@ -33,12 +33,12 @@ static int pci_mmc_probe(struct udevice *dev) host->ioaddr = (void *)dm_pci_map_bar (dev,PCI_BASE_ADDRESS_0 ,PCI_REGION_MEM ); host->name = dev->name; + host->mmc = &plat->mmc; + host->mmc->dev = dev;
How about putting through three lines in a common function in mmc-uclass.c (with args 'host', dev and play) since they appear in a lot of drivers.
Regards,
Simon
PATCH 5/7 mmc: s5p: fix uninitialized pointer deref on probe
In reply to Peng FanCommit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field.
--- drivers/mmc/s5p_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/s5p_sdhci.c +2 -2
@@ -204,13 +204,13 @@ static int s5p_sdhci_probe(struct udevice *dev)if (ret)return ret; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,0 ,400000 );if (ret)return ret; - host->mmc = &plat->mmc; host->mmc->priv = host; - host->mmc->dev = dev; upriv->mmc = host->mmc;return sdhci_probe (dev);
Signature · 1 line
2.16.4
PATCH 6/7 mmc: sdhci-cadence: fix uninitialized pointer deref on probe
In reply to Peng FanCommit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field.
--- drivers/mmc/sdhci-cadence.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/sdhci-cadence.c +2 -1
@@ -269,12 +269,13 @@ static int sdhci_cdns_probe(struct udevice *dev)if (ret)return ret; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,0 ,0 );if (ret)return ret; upriv->mmc = &plat->mmc; - host->mmc = &plat->mmc; host->mmc->priv = host;return sdhci_probe (dev);
Signature · 1 line
2.16.4
PATCH 6/7 mmc: sdhci-cadence: fix uninitialized pointer deref on probe
Quoted 9 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Masahiro Yamada <[email protected]>Signed-off-by Peng Fan <[email protected]>
Signature · 2 lines
Best Regards Masahiro Yamada
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
In reply to Peng FanThis has to go as soon as possible into the tree.
The at91 boards do not boot without this. The commit checking for sdhci-caps-mask introduces a crash at this point.
I can take it through atmel tree if needed.
Thanks,
Eugen
Quoted 34 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Wenyou Yang <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/atmel_sdhci.c +2
-2@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice *dev)return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,0 ,ATMEL_SDHC_MIN_FREQ );if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Quoted 10 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeTested-by Eugen Hristev <[email protected]>This has to go as soon as possible into the tree.
The at91 boards do not boot without this. The commit checking for sdhci-caps-mask introduces a crash at this point.I can take it through atmel tree if needed.
I need wait R-b and A-b for other patches in the patchset, Then PR to Tom. So please take this patch if hurry, and mark patchwork as accepted.
Thanks,
Peng.
Quoted 41 lines
Thanks,
EugenQuoted 18 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Wenyou Yang <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/atmel_sdhci.c +0
-0drivers/mmc/atmel_sdhci.c static int atmel_sdhci_probe(struct udevice *dev) · line 94
Quoted 7 lines
drivers/mmc/atmel_sdhci.c +2
-0@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice *dev)return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret = sdhci_setup_cfg(&plat->cfg, host, 0,
ATMEL_SDHC_MIN_FREQ);Quoted 9 lines
drivers/mmc/atmel_sdhci.c +0
-2if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Quoted 10 lines · Peng Fan
Quoted 10 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeTested-by Eugen Hristev <[email protected]>This has to go as soon as possible into the tree.
The at91 boards do not boot without this. The commit checking for sdhci-caps-mask introduces a crash at this point.
Quoted 7 lines
Quoted 1 line
I can take it through atmel tree if needed.
I need wait R-b and A-b for other patches in the patchset, Then PR to Tom. So please take this patch if hurry, and mark patchwork as accepted.
As it looks to me all the other platforms have the same issue. So they are just as urgent. In this case I assume it won't take long for all of them to be taken, so, it's fine.
Just one question, why did you not move all the 4 initialization lines before the sdhci_setup_cfg ? Other drivers initialize all 4 before the call.
Eugen
Quoted 44 lines
Thanks,
Peng.Quoted 41 lines
Thanks,
EugenQuoted 18 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Wenyou Yang <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/atmel_sdhci.c +0
-0drivers/mmc/atmel_sdhci.c static int atmel_sdhci_probe(struct udevice *dev) · line 94
Quoted 7 lines
drivers/mmc/atmel_sdhci.c +2
-0@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice *dev)return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret = sdhci_setup_cfg(&plat->cfg, host, 0,
ATMEL_SDHC_MIN_FREQ);Quoted 9 lines
drivers/mmc/atmel_sdhci.c +0
-2if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Quoted 25 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeQuoted 10 lines · Peng Fan
Quoted 10 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeTested-by Eugen Hristev <[email protected]>This has to go as soon as possible into the tree.
The at91 boards do not boot without this. The commit checking for sdhci-caps-mask introduces a crash at this point.Quoted 7 lines
Quoted 1 line
I can take it through atmel tree if needed.
I need wait R-b and A-b for other patches in the patchset, Then PR to Tom. So please take this patch if hurry, and mark patchwork as accepted.
Quoted 6 lines
As it looks to me all the other platforms have the same issue. So they are just as urgent. In this case I assume it won't take long for all of them to be taken, so, it's fine.
Just one question, why did you not move all the 4 initialization lines before the
sdhci_setup_cfg? Other drivers initialize all 4 before the call.
Only dev is required to address the issue.
Regards,
Peng.
Quoted 48 lines
Eugen
Quoted 44 lines
Thanks,
Peng.Quoted 41 lines
Thanks,
EugenQuoted 18 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Wenyou Yang <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/atmel_sdhci.c +0
-0drivers/mmc/atmel_sdhci.c static int atmel_sdhci_probe(struct udevice *dev) · line 94
Quoted 7 lines
drivers/mmc/atmel_sdhci.c +2
-0@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice *dev)return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret = sdhci_setup_cfg(&plat->cfg, host, 0,
ATMEL_SDHC_MIN_FREQ);Quoted 9 lines
drivers/mmc/atmel_sdhci.c +0
-2if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Quoted 25 lines · Peng Fan
Quoted 25 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeQuoted 17 lines · Peng Fan
Quoted 11 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeTested-by Eugen Hristev <[email protected]>This has to go as soon as possible into the tree.
The at91 boards do not boot without this. The commit checking for sdhci-caps-mask introduces a crash at this point.I can take it through atmel tree if needed.
I need wait R-b and A-b for other patches in the patchset, Then PR to Tom. So please take this patch if hurry, and mark patchwork as accepted.
Quoted 9 lines
Quoted 6 lines
As it looks to me all the other platforms have the same issue. So they are just as urgent. In this case I assume it won't take long for all of them to be taken, so, it's fine.
Just one question, why did you not move all the 4 initialization lines before the
sdhci_setup_cfg? Other drivers initialize all 4 before the call.Only dev is required to address the issue.
True. But other drivers perform all 4 initializations. In the future the sdhci core might again make wrong assumptions about them, and we might get another crash?
Why not move all the 4 lines now ? It looks like they are just backpointers. So I would say the initialization of the pointers is incomplete before the sdhci_setup_cfg call, would be better to do it completely
Eugen
Quoted 51 lines
Regards,
Peng.Quoted 48 lines
Eugen
Quoted 44 lines
Thanks,
Peng.Quoted 41 lines
Thanks,
EugenQuoted 18 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask")Cc Faiz Abbas <[email protected]>Cc Wenyou Yang <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/mmc/atmel_sdhci.c +0
-0drivers/mmc/atmel_sdhci.c static int atmel_sdhci_probe(struct udevice *dev) · line 94
Quoted 7 lines
drivers/mmc/atmel_sdhci.c +2
-0@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice *dev)return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret = sdhci_setup_cfg(&plat->cfg, host, 0,
ATMEL_SDHC_MIN_FREQ);Quoted 9 lines
drivers/mmc/atmel_sdhci.c +0
-2if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
PATCH 1/7 mmc: atmel_sdhci: fix uninitialized pointer deref on probe
Quoted 37 lines
Quoted 26 lines
Quoted 26 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeQuoted 17 lines · Peng Fan
Quoted 11 lines
Subject: Re: [U-Boot] [PATCH 1/7] mmc:
atmel_sdhci: fix uninitialized pointer deref on probeTested-by Eugen Hristev <[email protected]>This has to go as soon as possible into the tree.
The at91 boards do not boot without this. The commit checking for sdhci-caps-mask introduces a crash at this point.I can take it through atmel tree if needed.
I need wait R-b and A-b for other patches in the patchset, Then PR to Tom. So please take this patch if hurry, and mark patchwork as accepted.
Quoted 6 lines
Quoted 6 lines
As it looks to me all the other platforms have the same issue. So they are just as urgent. In this case I assume it won't take long for all of them to be taken, so, it's fine.
Just one question, why did you not move all the 4 initialization lines before the
sdhci_setup_cfg? Other drivers initialize all 4 before thecall.
Quoted 3 lines
Only dev is required to address the issue.
Quoted 6 lines
True. But other drivers perform all 4 initializations. In the future the sdhci core might again make wrong assumptions about them, and we might get another crash?
Why not move all the 4 lines now ? It looks like they are just backpointers. So I would say the initialization of the pointers is incomplete before thesdhci_setup_cfgcall, would be better to do it completely
After checking the code, sdhci.c is common code, priv pointer should be not used there. So no need to move priv here.
and upriv is used by mmc uclass.
The remaining 2 has no chance to be used by sdhci.c.
Regards,
Peng.
Quoted 56 lines
Eugen
Quoted 30 lines
Regards,
Peng.Quoted 27 lines
Eugen
Quoted 23 lines
Thanks,
Peng.Quoted 20 lines
Thanks,
EugenQuoted 14 lines · Peng Fan
Commit
3d296365e4e8("mmc: sdhci: Add support for sdhci-caps-mask")sdhci_setup_cfg()expects a validsdhci_hostmmc field.Fixes 3d296365e4e8 ("mmc: sdhci: Add support forsdhci-caps-mask")
Cc Faiz Abbas <[email protected]>Cc Wenyou Yang <[email protected]>Signed-off-by Peng Fan <[email protected]>--- drivers/mmc/atmel_sdhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
drivers/mmc/atmel_sdhci.c static int atmel_sdhci_probe(struct udevice
Quoted 5 lines
drivers/mmc/atmel_sdhci.c +0
-0@@ -88,13 +88,13 @@ static int atmel_sdhci_probe(struct udevice*dev)
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
drivers/mmc/atmel_sdhci.c static int atmel_sdhci_probe(struct udevice *dev)
Quoted 7 lines
drivers/mmc/atmel_sdhci.c +2
-0return -EINVAL ; host->max_clk = max_clk; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret = sdhci_setup_cfg(&plat->cfg, host, 0,
ATMEL_SDHC_MIN_FREQ);Quoted 9 lines
drivers/mmc/atmel_sdhci.c +0
-2if (ret)return ret; - host->mmc = &plat->mmc; - host->mmc->dev = dev; host->mmc->priv = host; upriv->mmc = host->mmc;
PATCH 7/7 mmc: tangier_sdhci: fix uninitialized pointer deref on probe
In reply to Peng FanCommit 3d296365e4e8 ("mmc: sdhci: Add support for sdhci-caps-mask") sdhci_setup_cfg() expects a valid sdhci_host mmc field.
--- drivers/mmc/tangier_sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/tangier_sdhci.c +2 -1
@@ -51,13 +51,14 @@ static int sdhci_tangier_probe(struct udevice *dev)/* MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_165_195 */ host->voltages =MMC_VDD_165_195 ; + host->mmc = &plat->mmc; + host->mmc->dev = dev; ret =sdhci_setup_cfg (&plat->cfg, host,SDHCI_TANGIER_FMAX ,SDHCI_TANGIER_FMIN );if (ret)return ret; upriv->mmc = &plat->mmc; - host->mmc = &plat->mmc; host->mmc->priv = host;return sdhci_probe (dev);
Signature · 1 line
2.16.4