Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1411688imm; Thu, 5 Jul 2018 22:53:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc4qu3x7ho7wCMob/Wr/S+1xG37ZhrGIxZDefEOag1Xo2Z/AYpnq+6lmMWS2jAEQ7S/oHpQ X-Received: by 2002:a17:902:301:: with SMTP id 1-v6mr8898229pld.127.1530856422200; Thu, 05 Jul 2018 22:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530856422; cv=none; d=google.com; s=arc-20160816; b=VW+fNtjd0GY7BTFAWPRDS4TtAkTmwaAx3nEJM/GtYUp6QjsaXZiVvVt1VGPUotbC7n +yu2vTaOqhbdU5RJeE/C0jb4Xhhbv66wjXKi9n7sWOnjPkzC6i9EGxLWKMTWWyrBsZHA vO4vGqis5mNB1lPZaOJjZ8X2WDOsW4D4cUj658TDyABnMFgHNgjDPiTvb6zADNZvAEi9 ZIZjGGApdPsDdWSprkI9hloB4Gv/eW+c6qkAOoGOTD/6hjpMYitpKgDkdTrn/C8Amerg jYsxEfZ7r6MFoTwKJ9GIEHpdi0RnmhnisDx17fPvKBkspinBGLXV36sIPljTtVpw0EaU 9oGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=I1gE1PRMWbQiz7s93X6QMbXTDs3tUWyj6XYu5wMcyp4=; b=k85eqdRu8aKZmRcXcL6mMVqWbBgq4Qwjw+MV/W37zodijaEnb/1q5CfsUpzCsGGAXR WGOrfSiIPF0w+sdLnpfaXNbPMPRWKDufpAFWJS3vrgksPUxzX8BpjV2oESf+RWDZokTT 0TgkP5pj6LNPW9LmiynWhWGonI3zLu8Wzdp7w5DhAZFswru85OjJNu6KtMy2ckI+eTlb 4oWWBxPJMgGu40ZXtwW1egyPQJ7FAmQs/d5+x2OeSqBONRGJS9rvsEMReffX+bW3FWuv w0L0AqPlBnni7oyS0GOOIlhQ3G2YFLXYT53TmJ0yuSLWRgZDs/NLa2gmJLPEclrEYa/Q EO4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p22-v6si7438758plo.141.2018.07.05.22.53.28; Thu, 05 Jul 2018 22:53:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934636AbeGFFwf (ORCPT + 99 others); Fri, 6 Jul 2018 01:52:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33912 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934578AbeGFFwd (ORCPT ); Fri, 6 Jul 2018 01:52:33 -0400 Received: from localhost (D57D388D.static.ziggozakelijk.nl [213.125.56.141]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3D410C18; Fri, 6 Jul 2018 05:52:32 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Bogendoerfer , Finn Thain , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 60/61] net/sonic: Use dma_mapping_error() Date: Fri, 6 Jul 2018 07:47:24 +0200 Message-Id: <20180706054714.636490440@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180706054712.332416244@linuxfoundation.org> References: <20180706054712.332416244@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Finn Thain [ Upstream commit 26de0b76d9ba3200f09c6cb9d9618bda338be5f7 ] With CONFIG_DMA_API_DEBUG=y, calling sonic_open() produces the message, "DMA-API: device driver failed to check map error". Add the missing dma_mapping_error() call. Cc: Thomas Bogendoerfer Signed-off-by: Finn Thain Acked-by: Thomas Bogendoerfer Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/natsemi/sonic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/natsemi/sonic.c +++ b/drivers/net/ethernet/natsemi/sonic.c @@ -71,7 +71,7 @@ static int sonic_open(struct net_device for (i = 0; i < SONIC_NUM_RRS; i++) { dma_addr_t laddr = dma_map_single(lp->device, skb_put(lp->rx_skb[i], SONIC_RBSIZE), SONIC_RBSIZE, DMA_FROM_DEVICE); - if (!laddr) { + if (dma_mapping_error(lp->device, laddr)) { while(i > 0) { /* free any that were mapped successfully */ i--; dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE);