MMC: meson: don't use priv host structure before we verify it
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 22 Aug 2016 08:52:25 +0000 (16:52 +0800)
committerKevin Hilman <khilman@baylibre.com>
Mon, 22 Aug 2016 12:47:55 +0000 (05:47 -0700)
The code of meson_mmc_irq is going to use mmeson_host
before the santity check of WARN_ON. I believe this's not
the code's intention, fix it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
drivers/mmc/host/meson-gxbb.c

index 96cd8830a124669a99996f626699dc2229f26e14..b226d529c0cb1466fe9f6cb75f4b37c2c62ac0a5 100644 (file)
@@ -626,7 +626,7 @@ static int meson_mmc_read_resp(struct mmc_host *mmc, struct mmc_command *cmd)
 static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
 {
        struct meson_host *host = dev_id;
-       struct mmc_request *mrq = host->mrq;
+       struct mmc_request *mrq;
        struct mmc_command *cmd = host->cmd;
        u32 irq_en, status, raw_status;
        irqreturn_t ret = IRQ_HANDLED;
@@ -634,6 +634,8 @@ static irqreturn_t meson_mmc_irq(int irq, void *dev_id)
        if (WARN_ON(!host))
                return IRQ_NONE;
 
+       mrq = host->mrq;
+
        if (WARN_ON(!mrq))
                return IRQ_NONE;
 
This page took 0.024539 seconds and 5 git commands to generate.