Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp834544pxu; Mon, 23 Nov 2020 05:29:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwK8OvNlZe7ivMneekdeXi2TXR7isQQIwTRaLhJgK5ZBrtMeXGxRraCBWFtpfZoF+KaHIMI X-Received: by 2002:a05:6402:10ce:: with SMTP id p14mr23536109edu.12.1606138167913; Mon, 23 Nov 2020 05:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606138167; cv=none; d=google.com; s=arc-20160816; b=y2XVju6HM5l+PNGUEW67qQIizJGo8eDMsjb3KTjnYvrlu/tbNaMjObQmEDGnhvHHDW tPaU1ziflKdoINalYxSpXD2fVHBYWQAure7rH9Mld8+oFmrzsJp+PSxdCB8FRmDeC9l+ xSqZHVEF+W2JbC0xOwIuPhfvlHGghSoAdkxxCvLhb6fNBsfCM9wx5QmTgCuQE1F5Q9m3 6P386Ts6jMgar4Y7Mz/R08a/quHSfML/X8BEuwkFS5i4+3fxs3nL3byM293Wiwnuj+1i bRTlLY+3y/51l46o6/w7AaO0rAwQs33f7Sb0qn+jJEi1qW/b2j1dByqYOIZSt3OGneNG qQfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JZO7KZC53VBOcPwxAHi5v1KTgacRJ9DquSqKoicuJnY=; b=DS9x/GlYdA5VyWN9V6XQ6cO2JJKEtACuHQRNuBAWX87hjIaOvabn0l6uMWkwzZOXfp bksrpzhhyxpz5nsTcaTBS/NKRy7zoP73eLoN1U1cV8Izo5fRjhnqii1FXO6pAarL7XgN ev4dig6+TXC15lIJjDaFZ2RyMnxT1tm9hRshnNNmZLhXTfzg/HsdpV+qcfoM4S4ZjjMM WnURUe5t4br5nhc9l0pRfo00lnqcu0YDQwkMoxUtK71hduKJdvyy9cePuYWpqtAPCBWU RE7zbvVkMO7XQi0fkjSDrymT49uym6YHCmrN1AM+0aIETDXdiQA6C8RLZFKZSBCLXgS7 4trA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nyX0zbiJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si2919231edq.302.2020.11.23.05.29.04; Mon, 23 Nov 2020 05:29:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=nyX0zbiJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388876AbgKWNYT (ORCPT + 99 others); Mon, 23 Nov 2020 08:24:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:46104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731362AbgKWMe2 (ORCPT ); Mon, 23 Nov 2020 07:34:28 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 BB9FB2158C; Mon, 23 Nov 2020 12:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134868; bh=qpZ4lN0hI29YLGGVP7/sOvtZ9R2wZvrWzs9gOJOWnik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nyX0zbiJstML6p4JSuvBpi6kPE4W7xp3lQwWjFX0DhD2VRo8ZZHzgOTIExXp93Gdc Dl3XHW+XjrY5QJE++7vqyTppSZdGTiv59A5QgzURxk0xAC62vfhdpVWpJ26wommDST 1Qytp5xKFqjzLitFsEwWnDhwaSCb8InTkcjLQpEc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chas Williams <3chas3@gmail.com>, Sebastian Andrzej Siewior , Jakub Kicinski Subject: [PATCH 5.4 002/158] atm: nicstar: Unmap DMA on send error Date: Mon, 23 Nov 2020 13:20:30 +0100 Message-Id: <20201123121820.068322068@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121819.943135899@linuxfoundation.org> References: <20201123121819.943135899@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Andrzej Siewior [ Upstream commit 6dceaa9f56e22d0f9b4c4ad2ed9e04e315ce7fe5 ] The `skb' is mapped for DMA in ns_send() but does not unmap DMA in case push_scqe() fails to submit the `skb'. The memory of the `skb' is released so only the DMA mapping is leaking. Unmap the DMA mapping in case push_scqe() failed. Fixes: 864a3ff635fa7 ("atm: [nicstar] remove virt_to_bus() and support 64-bit platforms") Cc: Chas Williams <3chas3@gmail.com> Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/atm/nicstar.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c @@ -1706,6 +1706,8 @@ static int ns_send(struct atm_vcc *vcc, if (push_scqe(card, vc, scq, &scqe, skb) != 0) { atomic_inc(&vcc->stats->tx_err); + dma_unmap_single(&card->pcidev->dev, NS_PRV_DMA(skb), skb->len, + DMA_TO_DEVICE); dev_kfree_skb_any(skb); return -EIO; }