Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2626542pxp; Mon, 14 Mar 2022 00:57:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy24X4e3G6eibVVn76bt0tdcDSJqslA0RYky4DPTaFengU3M9aBdluAeOQ0YCubqNTKRSlu X-Received: by 2002:a05:6a00:a23:b0:4f6:72a8:20c7 with SMTP id p35-20020a056a000a2300b004f672a820c7mr22412306pfh.12.1647244634507; Mon, 14 Mar 2022 00:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647244634; cv=none; d=google.com; s=arc-20160816; b=L/VUorkUdp1TfaTjBNLFGuLmLSZwx8EuDbuC2suJaP1V5V2UPZILxTF4qFqJF5YKXZ 3kh0ZFHRucR9hI2dt0JTDENj0jV0ubVSpJsg5Y8uxak9dMK+TN00qRn+HYYO57TVLeag qQYWxSSdodEatDBgfgvY+wOWxlpEefrFDcGYgDLjTFyP66r4KBGXM9AKDNfEhiPA3Zd5 tWPe6YSKcvKNhQ/g5aBnfLrxHRgUcBbcxCIu6diLxpoKzh613GAh0mxXp4b2oWhZvtKx 1EVyckmzZ8c7WSa7SpA++4rHWlW5woE32j7HOKzpOlZybCTI/8jt/iVmUG6+n/YRQSCH tsOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=O9/rDPL/DXk+WwPeU2HgM139ZS9ctkViy8SgREVcLRA=; b=vCGdhNc7/qpD+st54XEEx61xlW3OivGluB5iW/oaAmpP/e2nbbd5Hu3rmGeQaSfu4Q TqL0jx8BFzVGU7j10WMeze1irsqdAtgL6N14g4AFpwFy1ncjzfHuifqERYKTWYK23v4q WCyFP1yhE/pJFMKF0rJDQN0V3tvCJGL5tnOOm+MKgMBUVFpfB34X8E960iU6UMpV3Xda IXKZsaBzOSZTKktYdP+nH8XiM2L5NG/c0ulfzWr6KEJ9k1w+DU7iZ1msBxgr2ZyBMCqm 9Tnp79Zd1pFUGs0MbbMjzk7bt4WfCAYlZ3d+xFPidSczxPevwiHRh6lFfZA6Olri6GsL cBsg== ARC-Authentication-Results: i=1; mx.google.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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a11-20020a1709027d8b00b0014b5d3dc9a8si12864285plm.572.2022.03.14.00.57.02; Mon, 14 Mar 2022 00:57:14 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235752AbiCNBgC (ORCPT + 99 others); Sun, 13 Mar 2022 21:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235757AbiCNBgA (ORCPT ); Sun, 13 Mar 2022 21:36:00 -0400 Received: from cstnet.cn (smtp23.cstnet.cn [159.226.251.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5504529C83; Sun, 13 Mar 2022 18:34:50 -0700 (PDT) Received: from localhost.localdomain (unknown [124.16.138.126]) by APP-03 (Coremail) with SMTP id rQCowAAnR5i5my5iQmO+Ag--.45289S2; Mon, 14 Mar 2022 09:34:49 +0800 (CST) From: Jiasheng Jiang To: kuba@kernel.org Cc: 3chas3@gmail.com, linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH v2] atm: eni: Add check for dma_map_single Date: Mon, 14 Mar 2022 09:34:48 +0800 Message-Id: <20220314013448.2340361-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: rQCowAAnR5i5my5iQmO+Ag--.45289S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtw4xXF1DWF47KFyDtF17trb_yoWfGrcEgr 4UZ342ga1kArn2k3yIqryYq3Z0ka1DXF4Durs2q3ZxW345ZryfXrykur1UJr129FWxGFnx t34qkrWrtrn8XjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb4xFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Cr0_ Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr 1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUGVWUXwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_ KwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r 1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij 64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr 0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4U MIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUdb18UUU UU= X-Originating-IP: [124.16.138.126] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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 As the potential failure of the dma_map_single(), it should be better to check it and return error if fails. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jiasheng Jiang --- Changelog: v1 -> v2 * Change 1. Change "enq_jam" to "enq_next". --- drivers/atm/eni.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 422753d52244..a31ffe16e626 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -1112,6 +1112,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags); skb_data3 = skb->data[3]; paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len, DMA_TO_DEVICE); + if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr)) + return enq_next; ENI_PRV_PADDR(skb) = paddr; /* prepare DMA queue entries */ j = 0; -- 2.25.1