From patchwork Thu Oct 10 16:26:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 175789 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2523412ill; Thu, 10 Oct 2019 09:26:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTQd00G7Bpr/tww3z6uu8TWYW3/DSD9fsSupa/ZrqjPwkdf53ao11CvtRgm+1chI5yhEsn X-Received: by 2002:a17:906:6451:: with SMTP id l17mr8986214ejn.114.1570724819199; Thu, 10 Oct 2019 09:26:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570724819; cv=none; d=google.com; s=arc-20160816; b=Hana1jHDWaiEPjeFWQmL/CW/57/GDBVj7FC9lmM5hQkMOrerDVyClV3ubLiFUcrraR XWnxNogxn+bhyh9knRw3NjJ0jtBWszv3wiHGQKuwv856yUmM4Kz9lmmRSuzlQ6aIz8Eb 4kpp0Yenxz7Wi/hfMpkUqla8X2mAEVXv5pVT4BGcEmLf+qDOadJC56hTw5cvoPHELChA glHxTI/3cAG7VBQzJ4I5Eb7MGJ45DwwQVso+/v9ULKofgxVhtSefuvswAzkW/9fgC/5N 0au0Djb+ADIw5u4+zu0DaPn7MRNht6opFGKaEsE9GOIogHogtpvuBuTJv1uHkqu5cgK5 Jtlg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=/3L9d8Hq5e07DU4XHZuzPz1Kd0iVbIQrEZ53Rw3PFwc=; b=DjhiXuO7XB31iBBV/D2Eg0WzjHCo5bd2jXM/LjfkBa7wFXw8cZnki1p5+YBEBxekAo 6sdxp7ZPrpeO246x4bBXJ9ZYvVgqdmq2MrjiwpA/22F/efuoISWBAXFE2VgccsJPAQ5M sLvFZA0JwBxC87qL29lcAQBTINaX96hu1umbWsAqzqcJ6R+LVyTHI9EjWyAcRgSpl71F Jmli1NZfzWF6VJilSZTuc+HDhT0ZuQt2l+rzAXW6hFSx1e64EnZACwKlezZJwrjt28vL eWONWk4EDOwAb9McCUdsRaNkZ3Fj14TyDq7UtX2Byv4u0MzHAfQnopXSD5exqn8UXJ6h clWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oMNG8OFl; 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 k9si3372962ejc.310.2019.10.10.09.26.59; Thu, 10 Oct 2019 09:26:59 -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=oMNG8OFl; 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 S1726290AbfJJQ06 (ORCPT + 21 others); Thu, 10 Oct 2019 12:26:58 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34690 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725901AbfJJQ05 (ORCPT ); Thu, 10 Oct 2019 12:26:57 -0400 Received: by mail-pl1-f194.google.com with SMTP id k7so3050341pll.1 for ; Thu, 10 Oct 2019 09:26:57 -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:mime-version :content-transfer-encoding; bh=/3L9d8Hq5e07DU4XHZuzPz1Kd0iVbIQrEZ53Rw3PFwc=; b=oMNG8OFlEGU3PWXGkW4uWbQiN1c4TgfEUV4U5ZaRnieGiVh9zJFF289MPunGMy0uQa seUQM8U2tTTWjYTuqnWM1hjDfz4EQSu6HMMR+BLW3eWSh4BlEZczW9TkQZKEJ/hk3f8b 1JFjuInD9NbbsOx1TTAGItzyuIrtHBAw+AvyLljpiKbRSLyrTzWMOLnm4O599EaVohmY qyXHpkXA478RmdObxZO9bhYjjODG2+x1geIWOUjM1C4N9VKcwAJdm2FwBoPqZPyewoBt HCAcvkfg29toUTW1/GIlRSFNFLn9cq68xGT5V8C627JjNT5+CYI49sBWZkhztGviM0xZ RQqA== 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:mime-version :content-transfer-encoding; bh=/3L9d8Hq5e07DU4XHZuzPz1Kd0iVbIQrEZ53Rw3PFwc=; b=t1khttK10YNE0inJEydnmyPhxDXCEU52qm2MlRMxehIkiaosm940qjKNnjLJstcgIo rCbawb5WZ1KnM0vVTY0TyXmE6dRi1z5kU0Vti1Lx5pJLqTpSFdVHP9qYRPimjt4fm89N eApPo+PCuzoNIk7q5jkWK+3DBWo3AaKHd39BwfFzAeXKzkDB7l+++HxSVqUY9WiWmAOJ Hv2TV9XMUoipC7MGmmAQl/nbmHqsWL8ybyJGnqrApo/xCs37Px5W6JoQwBe+z9yuStqy 3Re8+xPQrf/ZQdMxwb6EY9iAp1YQeF7dV9nJLpGWjnplzj9GQrMc2V0aiVTKZJToLNC1 aTSA== X-Gm-Message-State: APjAAAXa4gZsgeSYpxDHimTeFGs40th3whsyU1Gdme6bk/6C+pgMy6Fo rrYullCUcx8E/S2bNlQTBjkuXg== X-Received: by 2002:a17:902:904b:: with SMTP id w11mr8623273plz.182.1570724816801; Thu, 10 Oct 2019 09:26:56 -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 o15sm6148342pjs.14.2019.10.10.09.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 09:26:56 -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 , stable@vger.kernel.org Subject: [PATCH] ath10k: Correct error check of dma_map_single() Date: Thu, 10 Oct 2019 09:26:53 -0700 Message-Id: <20191010162653.141303-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.23.0 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(), rather than testing for NULL. Correct this. Fixes: 1807da49733e ("ath10k: wmi: add management tx by reference support over wmi") Cc: stable@vger.kernel.org Reported-by: Niklas Cassel Signed-off-by: Bjorn Andersson --- drivers/net/wireless/ath/ath10k/mac.c | 2 +- 1 file changed, 1 insertion(+), 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..a01868938692 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3904,7 +3904,7 @@ 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)) continue; ret = ath10k_wmi_mgmt_tx_send(ar, skb, paddr); if (ret) {