ar71xx/ath79: ag71xx: dont fetch the same var again
[openwrt/staging/stintel.git] / target / linux / brcm2708 / patches-4.19 / 950-0388-bcm2835-mmc-Handle-mmc_add_host-errors.patch
1 From b4a62a0eae7852a4dde5f055bb89833ea80d554a Mon Sep 17 00:00:00 2001
2 From: Lukas Wunner <lukas@wunner.de>
3 Date: Tue, 22 Jan 2019 12:29:45 +0100
4 Subject: [PATCH 388/725] bcm2835-mmc: Handle mmc_add_host() errors
5
6 The BCM2835 MMC host driver calls mmc_add_host() but doesn't check its
7 return value. Errors occurring in that function are therefore not
8 handled. Fix it.
9
10 Signed-off-by: Lukas Wunner <lukas@wunner.de>
11 Cc: Frank Pavlic <f.pavlic@kunbus.de>
12 ---
13 drivers/mmc/host/bcm2835-mmc.c | 8 +++++++-
14 1 file changed, 7 insertions(+), 1 deletion(-)
15
16 --- a/drivers/mmc/host/bcm2835-mmc.c
17 +++ b/drivers/mmc/host/bcm2835-mmc.c
18 @@ -1398,10 +1398,16 @@ static int bcm2835_mmc_add_host(struct b
19 }
20
21 mmiowb();
22 - mmc_add_host(mmc);
23 + ret = mmc_add_host(mmc);
24 + if (ret) {
25 + dev_err(dev, "could not add MMC host\n");
26 + goto free_irq;
27 + }
28
29 return 0;
30
31 +free_irq:
32 + free_irq(host->irq, host);
33 untasklet:
34 tasklet_kill(&host->finish_tasklet);
35