Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2272295pxp; Mon, 21 Mar 2022 15:32:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw04qzpb/zyYYfY48v19dwd3S5EZqH3SVZxJIodZoprVHR5g+0WQEgiUeyfBMtu0ddMXHav X-Received: by 2002:a17:902:cecb:b0:154:68b6:cf61 with SMTP id d11-20020a170902cecb00b0015468b6cf61mr4764633plg.12.1647901927324; Mon, 21 Mar 2022 15:32:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647901927; cv=none; d=google.com; s=arc-20160816; b=nEMoa1IyyqWtWMoHp6EF5Nop4oaYH3LG4Wb4phSm6kGoTGB+S+zKRRqTXgUX4NtetO OFdmThjS4MH9cWuv0tb2rTLMms3jsVROvHi9qw36BBeXCUE3SiVuiy21X+7gHPol45l2 e5nzidhrbc5Htr8fLtzPcg62V2jxDUMXZh9YZ4Lq6UhAuCA4o8BXzu8XkIzLZVRSjVUm /S3bMoAzRXg2h3huYUpqY5mUdXAhuOgIJrGyLK7oVNz1F1E0u/fSgnSudInm7u67+RjY kQpjvugxyF5I0USY4WlV5zVbx7whNKljdafjQLghJUTBNoeUhirazHubUyxwVvYdJHpw 3H2w== 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=9yNW3FiwcRkBbOcAoljo8yUjoK1eKqxE9aydaRDYmqY=; b=pteOTbUehXPt5QQd5X7Ufgj+rwhPBBnWbTfOdf/TjusZUgfOG2CFNGcffe+AYfozL0 FgNm8IZrbon0N4RkZ2LK+ZA6lOL1xi24EWj7nt2CPPJn79GRon0fCUKk0UlzMcCeDI/n 4+zcAn+rJV8Rg2ji3hNfI9qrniCxGTH/ARWtw0VzX2xr+Qr8hhrrLVI4kgyy3fterRX7 T8HfHbD2c1Xu4cEN7vP6BYS5LS+dsMiL6AroB/tQFEA44mCv+xbb7duP92muTsx/pH9B E9v1HPmce0UDbJ9EzFZYp3aOAapYsqvEhyyRUCU24i3nO/nbkZNzBUCuj15gifYR1vUy sl8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xAmYFkcX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 198-20020a6301cf000000b003816043ee32si13784643pgb.39.2022.03.21.15.32.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 15:32:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xAmYFkcX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 565AD2AB066; Mon, 21 Mar 2022 14:45:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347496AbiCUOGs (ORCPT + 99 others); Mon, 21 Mar 2022 10:06:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348968AbiCUN6o (ORCPT ); Mon, 21 Mar 2022 09:58:44 -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 820C116068F; Mon, 21 Mar 2022 06:56:53 -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 A98C2B81674; Mon, 21 Mar 2022 13:56:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05612C340ED; Mon, 21 Mar 2022 13:56:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647871009; bh=R1mmyF3W66JcYlAvZpdgAFCo4BLEqOwTQIP0aFl0cmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xAmYFkcXoedm4ZPHPRPDMZDyAIFxbh959xhdPylZZ3r72dJ3EmEINi3wbcJx6WpaK d81U9rGf0n+iqLxBegjBpeY2zpKQVLnHFPSs79D5kDmiLA8dEs4OiQRO9CqWEC16OT My5DRnbl0gYXyxXPJhqRnII2gXL9DK3wrnjLmS3E= 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 4.19 49/57] atm: eni: Add check for dma_map_single Date: Mon, 21 Mar 2022 14:52:30 +0100 Message-Id: <20220321133223.409660032@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220321133221.984120927@linuxfoundation.org> References: <20220321133221.984120927@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 1409d48affb7..f256aeeac1b3 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -1114,6 +1114,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags); } 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