Hi Shailendra,

On Mon, Jan 30, 2017 at 5:55 AM, Shailendra Verma
<shailendr...@samsung.com> wrote:
> of_match_device could return NULL, and so can cause a NULL
> pointer dereference later.

Can it? The driver uses DT exclusively.
There is no legacy platform code creating "mxs-spi" platform devices.

> Signed-off-by: Shailendra Verma <shailendr...@samsung.com>
> ---
>  drivers/spi/spi-mxs.c |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
> index 5b0e9a3..c3aea7e 100644
> --- a/drivers/spi/spi-mxs.c
> +++ b/drivers/spi/spi-mxs.c
> @@ -470,6 +470,11 @@ static int mxs_spi_probe(struct platform_device *pdev)
>          */
>         const int clk_freq_default = 160000000;
>
> +       if (!of_id) {
> +               dev_err(&pdev->dev, "Error: No device match found\n");
> +               return -ENODEV;
> +       }
> +

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Reply via email to