From patchwork Sun Dec 29 17:17:57 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: 182550 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5455929ild; Sun, 29 Dec 2019 09:41:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyyskC8O/NTCWD3SfKXiFzNlmy/s3TCT04ZKBk8ljoJ3frOf29zoiGCOU5dmUjoEWHpbg5T X-Received: by 2002:a9d:6b12:: with SMTP id g18mr67329197otp.211.1577641268365; Sun, 29 Dec 2019 09:41:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641268; cv=none; d=google.com; s=arc-20160816; b=AwNxxaLXes4J0oDV73PcCa9mSTyHc4HXgA6bSBiOn1TfVXpSYvN/WH9qM/LhBMKIwh Ok45JBAON7PdTk5MpcTpJxylrCorFUz7khOr0rHtopeZcwQn/dplAAMZGSkR8rKcTfq7 lRiGlDYrIc33he6jjinhK4A+bmX7lh6vbh4EbecXdztz1Fv17s8r5P9gw+y6Yoa9jJLs mFHIr5lcyeSTTV8shj0q0HsldB8pBS0ry2B+o2iFgrp/Sud2x4DRsY39BvHgT/4gR+Aj Aq2iiyLLfCDw56K5lU6Fi9lrNDMCC2n41fjbEQyGkXF44bUJcpEe3b1XPdiJW/7ZxJ2T 0odA== 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=cUSWlA3Fz7HS92QT5Y8BIogA7yasF5TSxB+sT5vtuY8=; b=CijrHCJP2+qNczrGMLbq/vQAQMM/DmK0TDVX4XpoS8b0f6C01hKKjQ3VVvrO/MwUZJ YiFnnDchW0b3p679ej56h93Lf9LBtWiBdJIYxOnjbTJm3m3LGxF08brvn7yenN+aNH6t fOODjy2wNkemYdiKqYQIRTQQ/jJJ0OU9IFVOwm5XNV8iwTIkUOezpkLZ1AYZmADbWZJS nEQlRjsRHVszHHKkoEWnsrHt1VfwDll3b3gZp/63ZmbKAFL3xhO4fQATEBATh9VQoV1u WZOY9o0ZL5hqYKZCHB34yNKX3e9lHkPFpUvNrHnkvNGvW3LnEJ0JgZR2okk2UyOevf6j 0z5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZpMAJSwx; 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 n139si20668398oig.121.2019.12.29.09.41.08; Sun, 29 Dec 2019 09:41:08 -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=ZpMAJSwx; 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 S1729999AbfL2RlG (ORCPT + 14 others); Sun, 29 Dec 2019 12:41:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:56858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728414AbfL2Rag (ORCPT ); Sun, 29 Dec 2019 12:30:36 -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 ECD3720722; Sun, 29 Dec 2019 17:30:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640635; bh=xgfG21dEu0LH+RzJCNRvuC1/quwx7EIbl/cBnZNiFUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZpMAJSwxAQmign0cLqI71T/2NzALDl+FhdJgiM3uzAjeoXLlVy5jTcml3/wznsAaV iwB7S7nbnOCFySDm6y0aG+Bnb6O54b751x1okVWt8F6Ja7yfQDiPNJj+okxfvCHtR2 5P+rf7Gyb5MyjnijoZjTsHljmsmhFjUlwVhHdQTw= 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 4.19 075/219] ath10k: Correct error handling of dma_map_single() Date: Sun, 29 Dec 2019 18:17:57 +0100 Message-Id: <20191229162517.375855022@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@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 174e0ce31c42..448e3a8c33a6 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3844,8 +3844,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",