staging: mt7621-mmc: Fix null pointer deref if ext sdio irq enabled
authorChristian Lütke-Stetzkamp <christian@lkamp.de>
Wed, 18 Apr 2018 15:27:24 +0000 (17:27 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Apr 2018 13:37:48 +0000 (15:37 +0200)
The enable|disable_sdio_irq() fields of msdc_hw are never set, so when
they are called, they are null pointer. In case of the
MSDC_EXT_SDIO_IRQ flag set in msdc0_hw, this happens. But because
these fields are never set, they can simply be removed.

Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-mmc/board.h
drivers/staging/mt7621-mmc/sd.c

index e4230770cd33afd6578f264cd74029a11e6ed91b..c4e014d0163596300268fc3d3a602338418adba1 100644 (file)
@@ -68,10 +68,6 @@ struct msdc_hw {
        /* external power control for card */
        void (*ext_power_on)(void);
        void (*ext_power_off)(void);
-
-       /* external sdio irq operations */
-       void (*enable_sdio_eirq)(void);
-       void (*disable_sdio_eirq)(void);
 };
 
 extern struct msdc_hw msdc0_hw;
index d803bfb456932db66d7a711b11c0f5150032af10..53866fda6beac344166d853d9a364e8da8cd086e 100644 (file)
@@ -2261,10 +2261,6 @@ static void msdc_ops_enable_sdio_irq(struct mmc_host *mmc, int enable)
        u32 tmp;
 
        if (hw->flags & MSDC_EXT_SDIO_IRQ) { /* yes for sdio */
-               if (enable)
-                       hw->enable_sdio_eirq();  /* combo_sdio_enable_eirq */
-               else
-                       hw->disable_sdio_eirq(); /* combo_sdio_disable_eirq */
        } else {
                ERR_MSG("XXX ");  /* so never enter here */
                tmp = sdr_read32(SDC_CFG);