Skip to content

Commit

Permalink
serial: sh-sci: Fix length of scatterlist
Browse files Browse the repository at this point in the history
This patch fixes an issue that the "length" of scatterlist should be
set using sg_dma_len(). Otherwise, a dmaengine driver cannot work
correctly if CONFIG_NEED_SG_DMA_LENGTH=y.

Fixes: 7b39d90 (serial: sh-sci: Fix NULL pointer dereference if HIGHMEM is enabled)
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Yoshihiro Shimoda authored and Greg Kroah-Hartman committed Dec 13, 2015
1 parent ac8f3bf commit d09959e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ static void sci_request_dma(struct uart_port *port)
sg_init_table(sg, 1);
s->rx_buf[i] = buf;
sg_dma_address(sg) = dma;
sg->length = s->buf_len_rx;
sg_dma_len(sg) = s->buf_len_rx;

buf += s->buf_len_rx;
dma += s->buf_len_rx;
Expand Down

0 comments on commit d09959e

Please sign in to comment.