On Wednesday 28 January 2009, Hugo Villeneuve wrote:
> The segmentation fault is caused when accessing a potential
> NULL host->data structure.

What's the status of finding the *underlying* bug of which this
was just a hard-to-observe symptom?  (I've never seen it, FWIW;
the MMC driver has been quite solid for me, great for rootfs.)

Does that segfault even appear in current code?

If this band-aid *were* needed, it should be dev_err().


> Signed-off-by: Hugo Villeneuve <[email protected]>
> ---
>  drivers/mmc/host/davinci_mmc.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
> index 8ea3902..9f19283 100644
> --- a/drivers/mmc/host/davinci_mmc.c
> +++ b/drivers/mmc/host/davinci_mmc.c
> @@ -430,6 +430,12 @@ static void mmc_davinci_dma_cb(unsigned channel, u16 
> ch_status, void *data)
>                * request was seen.  In the future, TC errors (like bad
>                * addresses) might be presented too.
>                */
> +             if (!host->data) {
> +                     dev_warn(mmc_dev(host->mmc),
> +                              "DMA error (host->data is NULL)\n");
> +                     return;
> +             }
> +
>               dev_warn(mmc_dev(host->mmc), "DMA %s error\n",
>                       (host->data->flags & MMC_DATA_WRITE)
>                               ? "write" : "read");
> 


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to