[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110923232936.GI24631@ponder.secretlab.ca>
Date: Fri, 23 Sep 2011 17:29:36 -0600
From: Grant Likely <grant.likely@...retlab.ca>
To: Jeff Harris <jeff_harris@...trox.com>
Cc: spi-devel-general@...ts.sourceforge.net,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] spi: Fix WARN when removing spi-fsl-spi module
On Fri, Sep 23, 2011 at 11:49:36AM -0400, Jeff Harris wrote:
> If CPM mode is not used, the fsl_dummy_rx variable is never allocated. When
> the cleanup attempts to free it, the reference count is zero and a WARN is
> generated. The same CPM mode check used in the initialize is applied to the
> free as well.
>
> Tested on 2.6.33 with the previous spi_mpc8xxx driver. The renamed
> spi-fsl-spi driver looks to have the same problem.
>
> Signed-off-by: Jeff Harris <jeff_harris@...trox.com>
Merged, thanks.
g.
> ---
> drivers/spi/spi-fsl-spi.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
> index d240755..24cacff 100644
> --- a/drivers/spi/spi-fsl-spi.c
> +++ b/drivers/spi/spi-fsl-spi.c
> @@ -825,6 +825,9 @@ static void fsl_spi_cpm_free(struct mpc8xxx_spi *mspi)
> {
> struct device *dev = mspi->dev;
>
> + if (!(mspi->flags & SPI_CPM_MODE))
> + return;
> +
> dma_unmap_single(dev, mspi->dma_dummy_rx, SPI_MRBLR, DMA_FROM_DEVICE);
> dma_unmap_single(dev, mspi->dma_dummy_tx, PAGE_SIZE, DMA_TO_DEVICE);
> cpm_muram_free(cpm_muram_offset(mspi->tx_bd));
> --
> 1.7.0.5
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists