From patchwork Sun Dec 29 17:23:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 182574 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5478684ild; Sun, 29 Dec 2019 10:08:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx7+Qx/ximrM1hkyu/4+vnglwTDSRN8MXcoCZjZVMu0QeBiKK61a1jsm/8aPG0YJV4So8qR X-Received: by 2002:a9d:6502:: with SMTP id i2mr42306711otl.206.1577642913918; Sun, 29 Dec 2019 10:08:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577642913; cv=none; d=google.com; s=arc-20160816; b=jJ4PQyZCjIvZemLyRi/Xo8vbrIbYbLGZtVVHw9nJBpYsYJpFUnrgVVA2ihEh0kKTxu ZDzzysEIsazxxyNIfOqlLfJFF0HpEBI0JYv+ydqAJ1Pl/0+B134mIQgMNH/JVpEZJ0XI eUkEZkn7r+QiQBDcC7mYt0a98M8v35LoKLwI05KOPz2pnBpr8am30E+3i1jl6HdA78ut yspA8zxDa8vmrv22J2NlUwDofl8WYjM4MWtNtCc+EES2QC2lrePbCX2/ycZyePCyzhDa KCrjA1RCPdKe28KS2JABJSScj66l81VogvLXhu7hbZU0WmxH4Kxf+qPJx4ryXs7acJOG r5WQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zVunRSPszcNGeSzZ9Dumk0EwWfmFsOkeo68Crr2G6iU=; b=yoe/hC6YOENugGeNke1fGOWcbj/MoYzUJpbJhtfzqVj9mVqOIy811J8npLCYCt7lur fCKxmlBv4n5y4jOw9Qyq+N7g4zLVltGTlScoUnOrAQ3DIiQ+hp2Vmo7a0WLV0RpqplPL uNt4FtWXcY3qFdByiTJgBb4Ge4zxvaEszDtfRE3wZFdRvXqt07NcidRFeP2g+/tVTUuY B2BS10H0cX9K/Nc1DfZImpfAGwDn6J7mVjhn3R9rCbdeHeeMRRGVF3dfwBsGvFALSExV w481/efHDyaq/2iscqk1FuHuN4NKxiLjYUD+ZWvAkkpwgfrF/Yp1CCqix9CfpK91GhhH BV5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yx1w1B6T; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 g8si11790063oia.262.2019.12.29.10.08.33; Sun, 29 Dec 2019 10:08:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=yx1w1B6T; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731204AbfL2SIb (ORCPT + 14 others); Sun, 29 Dec 2019 13:08:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:57488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731199AbfL2RrH (ORCPT ); Sun, 29 Dec 2019 12:47:07 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 61353206A4; Sun, 29 Dec 2019 17:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641626; bh=aLZtRPo3J/10vYacInLSi2e43+VprTKkpjOLkrQxtFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yx1w1B6TgV3dcIlHcdCwrrZy265VBrmN3U25H/2dyztUuZdMw4kIIWxctwM5dWcdi SOINXn0KY67cYFIML1904B+cmKp8oxJQ+H5R7LY6CK5g4YLs3LuWKOk8KbAvGxVXs+ 5Ih1+6h+HMILwoErSS4F0QlQ5vZFQv7myTfCa/rw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Bjorn Andersson , Kalle Valo , Sasha Levin Subject: [PATCH 5.4 142/434] ath10k: Correct error handling of dma_map_single() Date: Sun, 29 Dec 2019 18:23:15 +0100 Message-Id: <20191229172711.169025164@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Bjorn Andersson [ Upstream commit d43810b2c1808ac865aa1a2a2c291644bf95345c ] 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. This was found when enabling CONFIG_DMA_API_DEBUG and it warned about the missing dma_mapping_error() call. Fixes: 1807da49733e ("ath10k: wmi: add management tx by reference support over wmi") Reported-by: Niklas Cassel Signed-off-by: Bjorn Andersson Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/mac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index a40e1a998f4c..2b53ea6ca205 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3903,8 +3903,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",