Re: [PATCHv3 1/6] SPI omap2_mcspi.c: Check params before dereference or use

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

 



On Mon, May 24, 2010 at 8:20 AM, Scott Ellis <scott@xxxxxxxxxxxxxx> wrote:
> Check spi->chip_select for range before use.
>
> The spi->controller_state check is already in 2.6.34-rc7
>
> Signed-off-by: Scott Ellis <scott@xxxxxxxxxxxxxx>

Okay, I've pick up this patch, but please check your Evolution
configuration.  Patchwork seems to be barfing on the patches sent by
you.  My guess is that it relies on a "---" line between the last
"signed-off-by", and the start of the actual patch.  See here to see
what I'm talking about:

https://patchwork.kernel.org/patch/101890/

Cheers,
g.

>
>  drivers/spi/omap2_mcspi.c |   19 +++++++++++--------
>  1 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
> index e0de0d0..0b35468 100644
> --- a/drivers/spi/omap2_mcspi.c
> +++ b/drivers/spi/omap2_mcspi.c
> @@ -755,7 +755,6 @@ static void omap2_mcspi_cleanup(struct spi_device
> *spi)
>        struct omap2_mcspi_cs   *cs;
>
>        mcspi = spi_master_get_devdata(spi->master);
> -       mcspi_dma = &mcspi->dma_channels[spi->chip_select];
>
>        if (spi->controller_state) {
>                /* Unlink controller state from context save list */
> @@ -765,13 +764,17 @@ static void omap2_mcspi_cleanup(struct spi_device
> *spi)
>                kfree(spi->controller_state);
>        }
>
> -       if (mcspi_dma->dma_rx_channel != -1) {
> -               omap_free_dma(mcspi_dma->dma_rx_channel);
> -               mcspi_dma->dma_rx_channel = -1;
> -       }
> -       if (mcspi_dma->dma_tx_channel != -1) {
> -               omap_free_dma(mcspi_dma->dma_tx_channel);
> -               mcspi_dma->dma_tx_channel = -1;
> +       if (spi->chip_select < spi->master->num_chipselect) {
> +               mcspi_dma = &mcspi->dma_channels[spi->chip_select];
> +
> +               if (mcspi_dma->dma_rx_channel != -1) {
> +                       omap_free_dma(mcspi_dma->dma_rx_channel);
> +                       mcspi_dma->dma_rx_channel = -1;
> +               }
> +               if (mcspi_dma->dma_tx_channel != -1) {
> +                       omap_free_dma(mcspi_dma->dma_tx_channel);
> +                       mcspi_dma->dma_tx_channel = -1;
> +               }
>        }
>  }
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux