From patchwork Thu Oct 22 06:41:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 7462581 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D21D0BEEA4 for ; Thu, 22 Oct 2015 06:41:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E5A6C208EE for ; Thu, 22 Oct 2015 06:41:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06ED2208D0 for ; Thu, 22 Oct 2015 06:41:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751553AbbJVGli (ORCPT ); Thu, 22 Oct 2015 02:41:38 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:9435 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751352AbbJVGlg (ORCPT ); Thu, 22 Oct 2015 02:41:36 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie3.idc.renesas.com with ESMTP; 22 Oct 2015 15:41:34 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id EA3C54D9A6; Thu, 22 Oct 2015 15:41:34 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id D5E421806F; Thu, 22 Oct 2015 15:41:34 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id CFEF21800A; Thu, 22 Oct 2015 15:41:34 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id RAG14850; Thu, 22 Oct 2015 15:41:34 +0900 X-IronPort-AV: E=Sophos;i="5.20,181,1444662000"; d="scan'";a="197021698" Received: from mail-sg2apc01lp0244.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.244]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 22 Oct 2015 15:41:33 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.144) by HK2PR06MB0913.apcprd06.prod.outlook.com (10.162.246.28) with Microsoft SMTP Server (TLS) id 15.1.306.13; Thu, 22 Oct 2015 06:41:32 +0000 From: Yoshihiro Shimoda To: , , , CC: , Yoshihiro Shimoda Subject: [PATCH] serial: sh-sci: Fix length of scatterlist Date: Thu, 22 Oct 2015 15:41:26 +0900 Message-ID: <1445496086-5972-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.4.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: HKXPR03CA0042.apcprd03.prod.outlook.com (10.141.129.32) To HK2PR06MB0913.apcprd06.prod.outlook.com (25.162.246.28) X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0913; 2:93Aoin3RyyVH3lgiyB5ASFeEBSQsXAWNbj9mhrakvoXrQIEumy4nlGSybLQEz11IIjjlfuniix3+9XqXOMDqnFjdaBeU6+TvMVEwCuF0b3B6gSGuUmT31ckYKFwV58BBI5zCYiQHMWnHHylD8IZ82E9Fv1evtvCIwkL1qLF8LGI=; 3:GnYn62chEj0tn9IRhccoLKvz3JYMgs37H1qmohdMwEhHAhk5V7s60SS4yEZ9QKMl/ZpwgOG27SY5HlKTQnu9BMekt2foFonegkdjiYqAM/NUkpZ2cXGgzzZK6zPYY6x6T7xyi9gZIGxAU0xX0Y5ocA==; 25:pupowrFTy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h6K8g7aGaOZhdS7AjSxQWReKBMgU/PzYr5NLeSP1YZmSZXOPKkui6hg+15ljT056aipN7kgTk5Pp6qzzKRU3hZMBwxc+ybiGm1lBWIzXvO3VO9qZ1g3O9TSWHbBXkDarw9psxpSH/Vr0j2YK67HDnVVK0ByLqwXfmb7MS5XN/4FwVKcZeHrNCdgFtVtH1sd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001)(102215026); SRVR:HK2PR06MB0913; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB0913; X-Forefront-PRVS: 0737B96801 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(189002)(199003)(5004730100002)(47776003)(2201001)(189998001)(106356001)(229853001)(50226001)(64706001)(19580395003)(87976001)(42186005)(92566002)(5001960100002)(105586002)(19580405001)(66066001)(5007970100001)(36756003)(5001920100001)(97736004)(77096005)(40100003)(48376002)(5001770100001)(42382002)(81156007)(122386002)(107886002)(5003940100001)(50466002)(5008740100001)(46102003)(33646002)(101416001)(76506005)(50986999)(78352002)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB0913; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2PR06MB0913; 23:UeLwX3Y6rYKD3o/gXVQROIWl7b/Okqu2rOR8Ez/so?= =?us-ascii?Q?n59VnRkzQRiJV/I24K4uM9qKLnbsANWlokclFNkDlWIDgPmq9IahqsV+O0sQ?= =?us-ascii?Q?YRhrsudl3bYdZMffCeRjzPKAi+Z6dEh/hdewqEQsaplR4vt5dYtU7kGlpqUf?= =?us-ascii?Q?akrj6YSEGCvEyBQV/DxF+LRfVbzmKERmmGs85irBFdN0GN+4VPpL0YGOAqM5?= =?us-ascii?Q?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Ss8HreOnC?= =?us-ascii?Q?gsvwuip+cr3DCQ5vuCtfTY2x4cEIks3dBef8nGnPMbgRPT5HFpa7A=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB0913; 5:7bIfMfor4bCrMtymdYsaElM0AL70c/mdnN4zv8RWGky9pQyfutCGCCVDfa4gDcA5pr8rFlWmQu2WLZsP/aa5Ra+M4zJz/JPoyTWAeLyxcWy09ZYtGgcWXQhoGMN9gNeH9vRUh/NzPzByXhGK7kzSaw==; 24:yl2E3QDyGlzkrUYc8w1qTJCE+CxnjJINFJrlTsgRHNssWDKOSnpa1G8CJwlfpoatcPe31SQ+Ec93HNo3gtuoMPUaNSgdL+A4kxIaK4q7kas=; 20:TgmgMhcmXZqgVjdIeNoEvoeZgbsIFZhABQA0v0A+4Nyqw0CFumOUEHdsm6ngrP+BwnEQ/kjpgbgptvPbWAqu6SgB8lcnyR5CB4H7n2J1zYso4b1BVVrkpCIt5L4dTe/DWSer9n/+hyr2obcePnfpa+PdYyzuvqNqlBfCzYLONz8= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2015 06:41:32.1912 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB0913 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-4.4 required=5.0 tests=AXB_X_OUTLOOKPROT_ENVSDR, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Geert Uytterhoeven --- Changes from v1: - Fix using implicit declaration of function "sg_dma_length". drivers/tty/serial/sh-sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 960e50a..51c7507 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c @@ -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;