On Wed, 2014-04-02 at 22:21 +0800, Axel Lin wrote:
> 
> Since commit 1e25cd4729bd "spi: Do not require a completion", this checking is
> required to prevent NULL pointer dereference.
> 
> Signed-off-by: Axel Lin <[email protected]>
> [ ... ]

> --- a/drivers/spi/spi-mpc512x-psc.c
> +++ b/drivers/spi/spi-mpc512x-psc.c
> @@ -300,7 +300,8 @@ static int mpc512x_psc_spi_msg_xfer(struct spi_master 
> *master,
>       }
>  
>       m->status = status;
> -     m->complete(m->context);
> +     if (m->complete)
> +             m->complete(m->context);
>  
>       if (status || !cs_change)
>               mpc512x_psc_spi_deactivate_cs(spi);

Haven't run-tested the change, but assuming that the .complete()
member became optional, the change is straight forward for it.
Looks good to me.


virtually yours
Gerhard Sittig
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: [email protected]
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to