From patchwork Tue Oct 20 12:18:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 7446351 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C34DE9F302 for ; Tue, 20 Oct 2015 12:18:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB33220873 for ; Tue, 20 Oct 2015 12:18:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4CE5320874 for ; Tue, 20 Oct 2015 12:18:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbbJTMSg (ORCPT ); Tue, 20 Oct 2015 08:18:36 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:37785 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752160AbbJTMSd (ORCPT ); Tue, 20 Oct 2015 08:18:33 -0400 Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 20 Oct 2015 21:18:31 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 9EF9E60321; Tue, 20 Oct 2015 21:18:31 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 992491806F; Tue, 20 Oct 2015 21:18:31 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 93CF91800A; Tue, 20 Oct 2015 21:18:31 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac3.idc.renesas.com with ESMTP id XAB29444; Tue, 20 Oct 2015 21:18:31 +0900 X-IronPort-AV: E=Sophos;i="5.17,707,1437404400"; d="scan'";a="198083005" Received: from mail-sg2apc01lp0240.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.240]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 20 Oct 2015 21:18:30 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost (211.11.155.144) by SIXPR06MB0921.apcprd06.prod.outlook.com (10.162.173.13) with Microsoft SMTP Server (TLS) id 15.1.300.14; Tue, 20 Oct 2015 12:18:29 +0000 From: Yoshihiro Shimoda To: , , , CC: , Yoshihiro Shimoda Subject: [PATCH] serial: sh-sci: Fix length of scatterlist Date: Tue, 20 Oct 2015 21:18:22 +0900 Message-ID: <1445343502-4436-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: HKXPR03CA0058.apcprd03.prod.outlook.com (10.141.129.48) To SIXPR06MB0921.apcprd06.prod.outlook.com (25.162.173.13) X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0921; 2:t0W/lyLblyGQi5TIr4EmvJH77xeFsx6UrWiO073DIjVzZ3H+XH8Q6XQXEewBDu8K9NbJA0+56SZ2NC4NjnADU6aTebzGEbbl6+Orb4vQx6YELp4M5xXYMGf2W2whJrGHRQkW6LZSNPlA0pi+h7g3nP3dGXEm1afABVEuKgBK1LU=; 3:pZrmakKBhzKuhEczEeh21N5TgnF1mVpW1Yf/C7n5pghu9QCC6fyDeFf+JjWNfFY8odi4I2ZH8MWDhBIA9399PxPJmk10vYA+fQ+jseiHZISAymMhDF+1FPAcl79NdPf1sXYQ6tssMJrvnvabK1LzkQ==; 25:TkgB5H+twzPVRrI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LynEkaKrgGqpUdiL0CjSJakd9nEEmbG2iAEooPScaoZoa3Ft8jNl828EUI91D/+rju3r3PBJJ1sRowmYg+gnuX88fdGsloX6P58I47ylVtOokQkI1tLLtKzv9C+EmeKjdRvEQXLBiJ8hnbotRn+qoDdQDbzUJZNNlWObybXA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(3002001); SRVR:SIXPR06MB0921; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0921; X-Forefront-PRVS: 073515755F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(6009001)(199003)(189002)(48376002)(229853001)(81156007)(33646002)(47776003)(97736004)(5004730100002)(46102003)(189998001)(40100003)(76506005)(42186005)(50466002)(122386002)(36756003)(5008740100001)(2201001)(5001960100002)(5007970100001)(5001770100001)(77096005)(66066001)(64706001)(107886002)(50986999)(101416001)(87976001)(78352002)(50226001)(105586002)(42382002)(106356001)(92566002)(19580405001)(5003940100001)(19580395003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB0921; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:0; MX:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB0921; 23:6IckTSMZz14LmxjCl7xIacXlK+Q/5b2thDyhDCFMl?= =?us-ascii?Q?KDkR18WBE19ZxX2iBha98hYzf78rpBSQBSJPs5RtXIL05VLUkb6dnImyDp3n?= =?us-ascii?Q?y01CccK+EYiT8vQwqD1S1t9OVbp5/bPpQ2MDCY2JFLhoa7O2V1H0KPSg/htU?= =?us-ascii?Q?z58XinNCGM83id1q7KzpqBqsDmfebWrOT+YIyFAvbLmvik5Ax20/yGYZCaJD?= =?us-ascii?Q?gRn/bLWqFZ6yoKwmY5A80k2d9Chn1EauofX4g7JYEqd/LSHmBrQ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exchange-Diagnostics: 1; SIXPR06MB0921; 5:UCpd3psFOA64US0Ev107N58PlCm9ONGOwWUE0c3hUn6QtVCh9V2WiktooIsz3lY/Xp6c3qZw88r/8xyPYhtZRWbYPN/VjnG2vmYINlmRW+LLSYuPhnLKzEGIxDNe6ScYYaAKHZR5Vf64w8cGfUvtQg==; 24:x8o4HsG3K9LmUEd6dd29jaVWZF8TI3pU7MsFySeYKzSblV9DgfLoC9q4F2yONFvWakAQuKaEsLqXIOl/7fXL6Ul6bnNBKVG6zjsYFrhgGqs=; 20:4GAQG4TT+ODGXcWanv/vBLOAJ/tfCeUtuWGtNej9AGfM97MJ+bgAsfP5qVPcclqQ6jpOteTPAu8a994JMFUZzVYXktenxi/+srnwbdIX8c83G/tuLKYYeIO8aPKePRukdRxQx/oalRPpvoDaBVqWjvN7utlCKJWElBuYoOENbSw= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2015 12:18:29.3177 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB0921 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-5.7 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 sh_dma_length(). 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 --- 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..284a872 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_length(sg) = s->buf_len_rx; buf += s->buf_len_rx; dma += s->buf_len_rx;