Received: by 2002:aa6:c429:0:b029:98:93ff:f56f with SMTP id g9csp3389386lkq; Mon, 23 Nov 2020 04:35:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJyTmzNZf949KjFCxOC79GXrAMb+s9O4sMjnTF28pNfTjEqODJH5LQQE+UOxWf9hk+SsRgSC X-Received: by 2002:aa7:d407:: with SMTP id z7mr48048266edq.234.1606134902272; Mon, 23 Nov 2020 04:35:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606134902; cv=none; d=google.com; s=arc-20160816; b=JXtUyRvMl3HXHvZOWG0Ed2d+Ex9EcPwljegq+zSzm8d9TLM/VCnYxn2ZbNbZMblyaJ MOmRgdY/ch95eMJYnIlqjwHHNg3DUQmcVZB5p8y7bUymewTvcj9pToeQo4KWHN2YDrgA lOteTafzcSKRVPu/l0a8u1n7l+P17ceM4F60U06oU3cnnBBhfDorOlW3ATAJBtgs4zDr b2piSda/F5068o1MLJBK8k7t1KoiSaLBr+s+omksaBm7THiDh974jIxYGx4e3twkt91b cRyReZLB2ReH9YSmUK4lGtJmnekhiH0eBKCKb9rUq7U7t/QIoPQTGH/kAXz9vSaE5alM pK5w== 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=pbW3czPLaWdsQ2cbL4qy88SOYs85/4O8Cf2qa7hDzy4=; b=qckJhKP50FXMo1U27JyOaUk494hyiO/O00h8vSq3W64z96iHQ1J1IQCkdg2LSOvb9K U0lSoZfnji8JWCgofBubLJzTHTVANywwzjn8+Rm7Flh/BOfdQx2hK70CRdsVX1RAxvGc UMGFa6SuMDW2lTKj6WCDj1EimhaZN9z6KtCVjRYlymsXIHrTDuT2v9CK4ix3vmTbP27v wBvoYIwi75aSuVYdjMHWNLZgq0Lmhew1YROWLGNbkpAZg9Knf8aPwBbO4KmrrHfqzhCg pqyPXwL7SjJpLpQfG5lEd/sddlnLkWIpf08+Cb/xt3lMV/WDqblI+/cebI0ynaInjdri llkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Xe5w9bLO; 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 v13si6383954eds.285.2020.11.23.04.34.39; Mon, 23 Nov 2020 04:35:02 -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=Xe5w9bLO; 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 S1730646AbgKWM3u (ORCPT + 99 others); Mon, 23 Nov 2020 07:29:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:40170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730615AbgKWM3j (ORCPT ); Mon, 23 Nov 2020 07:29:39 -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 CAFDD2076E; Mon, 23 Nov 2020 12:29:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606134577; bh=N+6/AxSR7d/JMxdSO1626shlY+dXERHa/WwSQepdL3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xe5w9bLOqAPgAstjSoCGY/lptkMPzVymt7aZuIVAEmTTOkxQkhdwdOuby7YKonzy/ vNFeQ7kGcTw9idQI4VA84U5y9jV5KrFVSPF+GQRmUgi/LO7g47+7vWTzAGy8wb5oYL 5LboxIaFoPB/K/fnor7a/8uA1AxId5Sk0XRv80VE= 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 4.19 02/91] atm: nicstar: Unmap DMA on send error Date: Mon, 23 Nov 2020 13:21:22 +0100 Message-Id: <20201123121809.413379627@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201123121809.285416732@linuxfoundation.org> References: <20201123121809.285416732@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 @@ -1705,6 +1705,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; }