From patchwork Fri Oct 11 18:28:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 176019 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1118951ill; Fri, 11 Oct 2019 11:28:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzN8HOqvDZCX4JpmpExbkRnK1b/zisqPzgsoQI5SXXJ/EO03NSR+3B0yOnZU7sHEFSdvQk+ X-Received: by 2002:aa7:c257:: with SMTP id y23mr14992951edo.39.1570818505014; Fri, 11 Oct 2019 11:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570818505; cv=none; d=google.com; s=arc-20160816; b=Cj0iubiI0CYoqwWO6R7JQCycR4T+esyK+mir2BKgCWSrdaps+r57Y1IsFx/mq4lcEX t4lKBkWr1fOIhBzOTiIat6oAiXV4hosmyJPnOGSFfgfdxv5nK+vYkT4uhwYhpzYtr+UV gfSy5vc/Kkx0KCnQfDqEnZYZeEmk8h6qOIog0JcQ4VxVZsjOdJCNVtUGgn6iT6I1uUsi owpaNbq2Nr2v8WDXchjdJ+k+E+tWRmJWK6A1Cl7ri0LIl7REQ5pb80D789XoBIfAT6sO Awvr/AaC0AZvEgeOl0/oXYeZs6WvnRGqLmt9sgFHnJVfJ2TSma+82RUbFqWMqyQNszLK N2wA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8oCcxD88VFm1cXltnKInhOC0dvYbRf3OZje5KuISZ28=; b=gmT/Ks+f8w0Wfy8KzEsmaMLe0X5Z6WuSYKLB7qw58u2VZ8ysQqd6Jj7g57kzv5LNuf WV5S0fHMsob17/8DlKmdSs59AjDB3MgYbggy/ZOZHiNHGOgPVyAo2U+RBew3E2D3tx1c pCT4tLq2aaHy6PoV+cG0ExfV0sH9U0R4PPfnds47nl0OI3Dnq8OTH3U6N5rrauyFoUHl j7h4kN6qVUwvvbO8dwmtnpomIkI6Oru9NecHbF0Q3HM5fOVNnx+LNsSTm9YlgiMiwaRv h7PZTRTMrgPliWYF0dYCbKDOoseP7m4S4+RsBes2S1ooeyCfPYExq33J6uH+RzZDLgA4 e5mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DmSSa+o/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si5850421ejk.20.2019.10.11.11.28.24; Fri, 11 Oct 2019 11:28:25 -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; dkim=pass header.i=@linaro.org header.s=google header.b="DmSSa+o/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728861AbfJKS2Y (ORCPT + 20 others); Fri, 11 Oct 2019 14:28:24 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37004 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728689AbfJKS2W (ORCPT ); Fri, 11 Oct 2019 14:28:22 -0400 Received: by mail-pf1-f194.google.com with SMTP id y5so6576277pfo.4 for ; Fri, 11 Oct 2019 11:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8oCcxD88VFm1cXltnKInhOC0dvYbRf3OZje5KuISZ28=; b=DmSSa+o/fbCnmcSE8r3LLdGEcw4nF+cZDPt6n9Uav/Mh/6eUQUBdpUuOVjFil99enF yW+l+bqqnjB2LexYRbSpMwtzwWFE8E9D/KnGVyNJulBfAtHABiiSDzWBGbr2X/OK+XT8 L9Hviw5kazL60EJ6JyhVmA3PsPTO5Un7UcOuq97b7+LwEoOnaInyOvbl78GA8DDCEIu4 pKdxSQq3K3wzCSHxveT1nB+mV+iSi/AR5oKe8Z4vigMNNzWYy96byVbfG3DpQQRkesij 1jl1r0OfXGl8OxMN96Wtp706aglMlW6IEQw6UURw+hIsGYJAX+wP3AqwzZkaV0dSvvrt Iz+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8oCcxD88VFm1cXltnKInhOC0dvYbRf3OZje5KuISZ28=; b=aMPqOHw25c5bxgAYvMwf2piQoDatAVsZ8r9jtfPPrfg6yg2bsJUu0NxB59JbbBd2r0 wbJjS7rqhslAPfE10bcOvzClaFfvKd3W1qrqkm+pk4waizKPOuQb1eKHw4LISo9RffrA qM4EnWpDzogrj56wMsIM4TXSyQS104AsxS1TmZ2kQlNqlcpK19DDtWjz5T+qzqOh031f mJu2rIE5O3U767+4veaL4Y1Si4/xw7AvLd9kJZAijJpqTXjPPCP4h/zshWRnxwCFKqQq y/HvuM26pv+PgjHXzbI8IFcxOB1CfCJvvGcGehx51iGm+AffHOGNMuDCEr5b2g1g+RUh QaRg== X-Gm-Message-State: APjAAAUxjjD2VURsAzI2yWMsf0YWjbv+OPb2vFn7PTLIFEVpM5/STP+W WqhCGHdoY9AqNdc2wM8HKniYfg== X-Received: by 2002:a17:90b:288:: with SMTP id az8mr19023217pjb.18.1570818501530; Fri, 11 Oct 2019 11:28:21 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id a11sm8652343pfo.165.2019.10.11.11.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Oct 2019 11:28:20 -0700 (PDT) From: Bjorn Andersson To: Kalle Valo , "David S. Miller" Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Niklas Cassel Subject: [PATCH v2] ath10k: Correct error handling of dma_map_single() Date: Fri, 11 Oct 2019 11:28:17 -0700 Message-Id: <20191011182817.194565-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010162653.141303-1-bjorn.andersson@linaro.org> References: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The return value of dma_map_single() should be checked for errors using dma_mapping_error() and the skb has been dequeued so it needs to be freed. Fixes: 1807da49733e ("ath10k: wmi: add management tx by reference support over wmi") Reported-by: Niklas Cassel Signed-off-by: Bjorn Andersson --- Changes since v1: - Free the dequeued skb drivers/net/wireless/ath/ath10k/mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.23.0 diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 3d2c8fcba952..e8bdb2ba9b18 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3904,8 +3904,10 @@ void ath10k_mgmt_over_wmi_tx_work(struct work_struct *work) ar->running_fw->fw_file.fw_features)) { paddr = dma_map_single(ar->dev, skb->data, skb->len, DMA_TO_DEVICE); - if (!paddr) + if (dma_mapping_error(ar->dev, paddr)) { + ieee80211_free_txskb(ar->hw, skb); continue; + } ret = ath10k_wmi_mgmt_tx_send(ar, skb, paddr); if (ret) { ath10k_warn(ar, "failed to transmit management frame by ref via WMI: %d\n",