浏览代码

serial: sh-sci: Fix length of scatterlist

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: 7b39d90184 (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>
Yoshihiro Shimoda 9 年之前
父节点
当前提交
d09959e752
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/tty/serial/sh-sci.c

+ 1 - 1
drivers/tty/serial/sh-sci.c

@@ -1437,7 +1437,7 @@ static void sci_request_dma(struct uart_port *port)
 			sg_init_table(sg, 1);
 			sg_init_table(sg, 1);
 			s->rx_buf[i] = buf;
 			s->rx_buf[i] = buf;
 			sg_dma_address(sg) = dma;
 			sg_dma_address(sg) = dma;
-			sg->length = s->buf_len_rx;
+			sg_dma_len(sg) = s->buf_len_rx;
 
 
 			buf += s->buf_len_rx;
 			buf += s->buf_len_rx;
 			dma += s->buf_len_rx;
 			dma += s->buf_len_rx;