Re: [PATCH] spi: coldfire-qspi: Prevent NULL pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 10, 2014 at 5:04 PM, Steven King <sfking@xxxxxxxxx> wrote:
> On Saturday 08 March 2014 10:11:10 pm Axel Lin wrote:
>> If pdata->cs_control is NULL, we will hit NULL pointer dereference in
>> mcfqspi_cs_select() and mcfqspi_cs_deselect(). Thus add NULL test for
>> pdata->cs_control in probe().
>
> D'oh!  My bad.  Actually you're right there would be a NULL pointer
> dereference in cs_select and cs_deselect  (I was looking at the cs_setup and
> cs_teardown in the patch) and so cs_control must not be NULL.  Thats want I
> get for replying before I've had my coffee and when I haven't looked at the
> code in awhile.  So yeah, the patch is GTG.

I had the same first impression. But after looking through the code, the
changes is fine. Furthermore, there's only on in-tree user it, which does
provide cs_control.

There's more opportunity for cleanup, though, as cs_control provides control
of a GPIO, which can be handled by the SPI core, too.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux