Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2284555pxp; Mon, 21 Mar 2022 15:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbVLrZUXH2i/DB6vQaFHiXti1MtQBVZhNkOtykMPLRD6mDf6NLIPMdq5qYoFwzKk4cAC9K X-Received: by 2002:a17:90a:ab08:b0:1bc:3ece:bdc with SMTP id m8-20020a17090aab0800b001bc3ece0bdcmr1540984pjq.32.1647903171560; Mon, 21 Mar 2022 15:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647903171; cv=none; d=google.com; s=arc-20160816; b=CrSEOI46moP6sA/eOYqgbX/ogcqLgSNlmfSVQy4O08U45CmKbAOeWl8gaNG1g+4+83 PxaRoK74H+GRVegc5BsuUN5u9+j1o/JcUyTU2wb25oapbQsXK+KGqtP8TOfOpUhm2Sgn DwXTv8KZcdOwqpeDWxm03v7Ry5oa94Q/HNLNjK5A95Ppl0nb3wWnjizHqoejPM4HRpNK eY6UwzoJJ++4QKJ0+KGajMv+mv+2wxAy+vrStJfMkEQDpfUpkxiDnFRLUUWGfRsBlO8L zWaI8TWT9Ua7bVmOhyPbooWRglWuj3aO7rXAreYw3zOlTYq7e54RaQin1nGE6isP6hLQ cCUw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2CldXFLq23UuSEpFc31ZCP9BXUDTYNsWP1zCH8AzKqk=; b=EEPSR7vVg53E6xM9uJ56bm74G6kWfynuAI7B4SCZAZ9I+0hZOlzMchtucYPpX5bkKY 7KmZC/q7u2HyQVcbSyMchMRB1cAAZ8cIQLWxgwjRes/lt9btyGGj9PNRqoj1hANH45vB JfAEbiBUSW4pEA6mn5/hL9FBQGX0acEE3EACY3DQEU7W8CPE5l7sP9XJF35AZ3Q3YyoR DPefp0roc83JNU3JP8Kbz7QFLC0R0S9KTRa5o8DRCkQX8Oa9bHISp9YeynT76YxHPBya gfMkBaXlIh+gMBPzSkkRIj15+NBB6ZGYeEbYbbSVXa92lhxFl+OTgrbQTSmJ73FGa0kO 4SIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qnn55/LA"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id cj20-20020a056a00299400b004fa900f2cdesi6330587pfb.149.2022.03.21.15.52.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:52:51 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qnn55/LA"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E3D373E19D9; Mon, 21 Mar 2022 15:00:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351606AbiCUOLR (ORCPT + 99 others); Mon, 21 Mar 2022 10:11:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349001AbiCUODO (ORCPT ); Mon, 21 Mar 2022 10:03:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A6DE17585F; Mon, 21 Mar 2022 07:00:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 75979B816E6; Mon, 21 Mar 2022 14:00:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB71FC340E8; Mon, 21 Mar 2022 14:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647871207; bh=qPfk6gLyWnnbd5V+f6dbSOSO0L4BM1LgWP0BU6fEpnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qnn55/LAakvDvJVCH9UdzbupZ8SSYbO3aurCm0x8z22lN1wlUpAPyP6h007PUD85U qXTZvqmRwmW7Bet+ldj+2v6ueeW4WnMqp6hszhsnBPYGItREQRrsn177r7FrpVxNI2 pzKh+trKIHgaL3t/wAKyJ2yFYCn9MLyno/QGHjE4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jiasheng Jiang , "David S. Miller" , Sasha Levin Subject: [PATCH 5.15 12/32] atm: eni: Add check for dma_map_single Date: Mon, 21 Mar 2022 14:52:48 +0100 Message-Id: <20220321133220.919335820@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133220.559554263@linuxfoundation.org> References: <20220321133220.559554263@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Jiasheng Jiang [ Upstream commit 0f74b29a4f53627376cf5a5fb7b0b3fa748a0b2b ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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.34.1