lkml.org 
[lkml]   [2011]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 6/6] pch_uart: Add initialize processing
    Date
    Add initialize variable to prevent duplicate free memory.

    Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
    ---
    drivers/tty/serial/pch_uart.c | 11 +++++++----
    1 files changed, 7 insertions(+), 4 deletions(-)

    diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
    index 8c750d8..efc30b9 100644
    --- a/drivers/tty/serial/pch_uart.c
    +++ b/drivers/tty/serial/pch_uart.c
    @@ -566,10 +566,13 @@ static void pch_free_dma(struct uart_port *port)
    dma_release_channel(priv->chan_rx);
    priv->chan_rx = NULL;
    }
    - if (sg_dma_address(&priv->sg_rx))
    - dma_free_coherent(port->dev, port->fifosize,
    - sg_virt(&priv->sg_rx),
    - sg_dma_address(&priv->sg_rx));
    +
    + if (priv->rx_buf_dma) {
    + dma_free_coherent(port->dev, port->fifosize, priv->rx_buf_virt,
    + priv->rx_buf_dma);
    + priv->rx_buf_virt = NULL;
    + priv->rx_buf_dma = 0;
    + }

    return;
    }
    --
    1.7.4.4


    \
     
     \ /
      Last update: 2011-11-17 07:01    [W:0.021 / U:122.380 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site