Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2387927rwd; Sun, 21 May 2023 20:13:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7WOm0xEY1+oOD9jNkzwSeoWb+JLE0yyxL4gO/idvFVMM8OWUAWnum3l+VWvyh32ekTotZO X-Received: by 2002:a05:6a20:440d:b0:105:53:991 with SMTP id ce13-20020a056a20440d00b0010500530991mr12320673pzb.0.1684725183088; Sun, 21 May 2023 20:13:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684725183; cv=pass; d=google.com; s=arc-20160816; b=iI7I6Rfsvsn+Txwr5Fn/mj9M6odkDE+yma4zYz1ADL0Fd/bfgBGgC8PZPm7Z2htLT4 Bc86fr6p0plAuNbvd+XzjHS1gYBGWzRScsM4MT6B3esX56uRZBikwptdczs+RyoZrUml x5NO9N0OjEkKsGks4AB1udwaPZWFBs3F6V5qC6Jm9oiGiODAbocEJ3C3TKl7Q3HRv+TL iMe7qV+oGxfrZi/XlGhWkG+zcOVXZCDtVhU8ZmK+xhTSv7s89IRfT1Cb/Hh+jwDOlqk+ BcWd/TmaKRDfaaZoiJS3V37iZO9dvbJ7NfwCjATtYqkMryFwEU3AnIXGC51tL1n138bf jV2A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=WynSM98sTJHnCUJAcU8pwa/Da7DgeJQNdTMfOjd/eVc=; b=D3yij1F6NF/+NaybIEU8yzrcL/SD9noNNU3uDXQ0BWTNX8bII6amqFjLKDPmwRFWes KlXr6dHo9dGd0XbqvPphA5v/YnEeCX6huX/62eMbQA/+cD05kQyox0N48rgmex7hni1t BN3cdEi/UmidtlACuczTXgYAQMuAUFl3YCAX4UmfA7VpiaRk55HlfRXPu1M04eq4XHJY WgZH9BngG8PEYnA7AiZUdA1KqkHHzY2SNEcHjzUveCsrxLEvQFAxNmZyk8MQ7gfuDvEe h1rvZBRSGP3hdrfIvcS4lSZikeJqnJwS+Fe2zEdnlwESW+heTYyMjFQnXRf3jEW8SbJG gCSg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Ns1V1+8d; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a636d04000000b0050f9b910fa1si4103329pgc.368.2023.05.21.20.12.50; Sun, 21 May 2023 20:13:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Ns1V1+8d; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229481AbjEVCzy (ORCPT + 99 others); Sun, 21 May 2023 22:55:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjEVCzw (ORCPT ); Sun, 21 May 2023 22:55:52 -0400 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on2040.outbound.protection.outlook.com [40.107.15.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE7B7C1; Sun, 21 May 2023 19:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZTPrn2LBgA6YlU8azukXpFaG0VVGmBmnjGmZWP3BPKq9gJogsZU4zeuYOpyqF2i4tSFA6aXkIeRQ5tCaUvzH/CYyVNRhW5vxleg72ghbL8hb1rK82ECxCM6ctkF+HYKfo0iw5IakQcJ+7o7AT8ySTettJNtc1EOMUhJ+eFWQUqbTXaa9/mPE3NnYm44pP/ZQ/kgAcW9pnGbLmWAUoIPJxKidpJMnZli7TzCJLYUtRsRon3kFBco7qqJarRBLQrJFUsHR6CMntaqF3tZu4GgdnPocQCc/eOioZ8NpadXkTGR7QlvAwiJYC0uvFuB2WjVPQeN+DNhfgxuDeAB3l3FiMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WynSM98sTJHnCUJAcU8pwa/Da7DgeJQNdTMfOjd/eVc=; b=HyhCxBgWiivLSZw9FXidcCLIxMNRR8lDaIkZ/HSs6WhXHymF94VPocUJZUICpJ1AA0EXal6MRId5GLhuGvO2O9VM81quWZUsjC0BvAKN2oL3WhwtVnG+KwDDQPdA1sQ2RNitf9YWQV4mC3y4Le+FLyncg6tmznIRjOQ1IhhgTbCNd8FUVdGxnvYN4ZNuC57eur9t5FZAk+ctoK+akZV33+S3+RxKv0KMi4qFrc7COnGS63r9wMpVQc1CHwwwnl8bWoVGLP7Y8iVVJxQIDTnzTNV6ru1ZZjJtrCSZzbJhgPjqUFeHtwf7iSM405Yy0PNunSnj2+VJRPtUuwRADs5yWQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WynSM98sTJHnCUJAcU8pwa/Da7DgeJQNdTMfOjd/eVc=; b=Ns1V1+8dIcPaHhxF0E9EALKqyVjSfLQYAOE4obQiaTfIUIe4yHw0XF3WSApxtBL1akcUVqKorp2RZ1jTHsTRsDE5wBvjP83By3m8PWwVkRA8ynF9uXJYgYMf3TTTVVQQAlH4wNyfjg/K6/sDJtSG5ZrJgyolUV6BA7sxe3iFFfM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) by PA4PR04MB9461.eurprd04.prod.outlook.com (2603:10a6:102:2a9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.27; Mon, 22 May 2023 02:55:47 +0000 Received: from AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::e1cd:e733:d3aa:ea49]) by AS8PR04MB8404.eurprd04.prod.outlook.com ([fe80::e1cd:e733:d3aa:ea49%7]) with mapi id 15.20.6411.028; Mon, 22 May 2023 02:55:47 +0000 From: Sherry Sun To: gregkh@linuxfoundation.org, jirislaby@kernel.org, shenwei.wang@nxp.com, ilpo.jarvinen@linux.intel.com Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-imx@nxp.com Subject: [PATCH] tty: serial: fsl_lpuart: Check the return value of dmaengine_tx_status Date: Mon, 22 May 2023 10:51:11 +0800 Message-Id: <20230522025111.3747-1-sherry.sun@nxp.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: SI2PR06CA0003.apcprd06.prod.outlook.com (2603:1096:4:186::14) To AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8404:EE_|PA4PR04MB9461:EE_ X-MS-Office365-Filtering-Correlation-Id: 2634d9c7-a7c1-4742-e535-08db5a700b07 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gAaoM9q0Or8QXQSKwBCz7+UPfT3USBiV+LmoBjleu6IqLiRtae/UssL3aN0k44ftcZlP9LSBP+vGbHeqY1xIwtKvzBZM1cLS89lbCm9g9sqQAGjOto3b/elSYvCkjRnRy8lpaL07Es8ZVXi7zgXAYCaZPlJ7mEyO31RMmdBy192x4aTZGXFf2HX9JqIBRrQ3gr9NjGaWF+/hTn11QoDXzVxtlXbE4S3RwZHfJRBbUFMnBqX+Fli+TX1n9ALjHk1/9dC0ys6VlZqJVSCUyBFwciI5/RVZA9QTrFPxR2t6F6G1cMxqqK+q5+u3e85r5l2tEcw9bhH+soBDOcSZc3iM+63sI33wXRLqM9YoENG5cpWN963U2EuVzNR00VHAu5Aq81rRu61XArqh4RFKYuiuIbCBoY6Kzf4qWATsVY6XzFLqIdnvEY81LK787hLI8Q5nZPDHuIRFoOQMpKEpUkZTaaZrflso9QyTg8cy1P0jxtV+lebQpMkParJiIxCp7G6hF4OSy7U8aTYU1+GBMtXS77O5rfUJAu2q1kq9wVS3IgwU9WOiic6N8ITRclw9ItRlb9C+sxdoQoAt4hq2zN4TdTEOPThZ420UyQ4y3D82r+zUoa3b3aGIzifFYmUK0H16 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8404.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(376002)(136003)(396003)(346002)(39860400002)(366004)(451199021)(8936002)(8676002)(5660300002)(44832011)(83380400001)(186003)(6512007)(6506007)(1076003)(26005)(2616005)(86362001)(38100700002)(38350700002)(41300700001)(6666004)(6486002)(52116002)(478600001)(66476007)(66946007)(66556008)(4326008)(316002)(36756003)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?dQ2tN6MhOqvcode1R/Zn1Xp+08Qc0SWJAo/nsTS5FFOZPYzJOSynamM3G0dj?= =?us-ascii?Q?z0Utg+AOZO9YKqBtd8NdnyywyDEyQOqKLO9VBeLZlYPq7N1hOXjvAoVetAwz?= =?us-ascii?Q?ycawU9PlCase5yA/x53i1pO926oEV/Tl31zKLWVkAqZOxTphwVOH5uQQi83z?= =?us-ascii?Q?SCPDCS+E6fAJslC46TKcy32A+9zcQ43qVx/Wj9CsLeUEHopmyiuWU7IPi75v?= =?us-ascii?Q?VHMPOXljDJFUVVNXn3zauc4pJ7CEpTgbgGRgNd1mHncuuWyWz6uQQqBl0sx8?= =?us-ascii?Q?jv2WS5d/ADTyelb+0cWpNW5bc9NBBXrjUXldGanPPNChabSy4o6QGqZSNqM+?= =?us-ascii?Q?wB1NcCns9cvPiDBKI13sJestRmIEQmV5Yrq55ftpwD4hMFESgNBuP4ntwX4h?= =?us-ascii?Q?RTHP5+R6rT7KsLm8QwmcDzKv6EIZaT+L7adUh1McVaPc62ZIvPONtRzuBmyD?= =?us-ascii?Q?yHtcos9J4u7c2DEganHOQkTYEBrxr3Me93JaPe+Th7SFeDU4GBdUOQ6s+5K5?= =?us-ascii?Q?ZpE5kxmvgJTZpxgeoUx6ukNAJbPAOUeJ9Pv/sDrw59KYaQ79rHpIXwUUzOTb?= =?us-ascii?Q?vGaec/DVX346MidJcnNL1r/fvCuxcsqWq7YVLWdNL1tAoYBvFHEOBb1EK7V5?= =?us-ascii?Q?EvYUlUESm0awstZ+bW2tZRBxM0AnJ3Z/4e6mi9NEfQLbIVQCRQqSL643Ixpl?= =?us-ascii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vEXulk?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2634d9c7-a7c1-4742-e535-08db5a700b07 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8404.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 02:55:47.3198 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UZUDF44cPUZZUeCFzu7CaZFsJlPLA1C4sWUYVB3m12EadLquL8IqzYalfU1r32xb9846p5aPmSclP6R7E7afzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB9461 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Coverity reports the Unchecked return value (CHECKED_RETURN) warning: Calling dmaengine_tx_status without checking return value. So here add the return value check for dmaengine_tx_status() function to make coverity happy. Fixes: cf9aa72d2f91 ("tty: serial: fsl_lpuart: optimize the timer based EOP logic") Signed-off-by: Sherry Sun --- drivers/tty/serial/fsl_lpuart.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 92a3bd0f4158..f2a47a8c5b85 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1286,13 +1286,19 @@ static void lpuart_dma_rx_complete(void *arg) static void lpuart_timer_func(struct timer_list *t) { struct lpuart_port *sport = from_timer(sport, t, lpuart_timer); + enum dma_status dmastat; struct dma_chan *chan = sport->dma_rx_chan; struct circ_buf *ring = &sport->rx_ring; struct dma_tx_state state; unsigned long flags; int count; - dmaengine_tx_status(chan, sport->dma_rx_cookie, &state); + dmastat = dmaengine_tx_status(chan, sport->dma_rx_cookie, &state); + if (dmastat == DMA_ERROR) { + dev_err(sport->port.dev, "Rx DMA transfer failed!\n"); + return; + } + ring->head = sport->rx_sgl.length - state.residue; count = CIRC_CNT(ring->head, ring->tail, sport->rx_sgl.length); -- 2.17.1