Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2653136pxa; Mon, 17 Aug 2020 15:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgg1GbkNAHAMZDik0hgdW8Rmb69aqDP/jJib6AN6A2FhL555Ca6glYvfYA8hmk1tk0FZlW X-Received: by 2002:a17:906:ce39:: with SMTP id sd25mr18207410ejb.80.1597703733634; Mon, 17 Aug 2020 15:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597703733; cv=none; d=google.com; s=arc-20160816; b=i75Xg32r7UbBq5An+Y22yMDGVRaiNkZRQ8cafOzyAIDRbK8VR5fQMj5lbT0xdzfyWl F+SuUTWHdsE1DiPZoJMLskNX4d6VKFTXGCxLRiJxnSOc55dIt0hQlomlGE6vSIBUmv26 X/owm7zjCV+GrI9dKqNYCN/tZOmwFvBRX/9OuSx+nl/moZN4vAdPBzVQLg2HVXjgTCy2 RfhRRzSNWCkpT0E+a8kjcHKI9E7dBnT938s4Qz3l6ZiUrXn/om4d7SS+iaMYTiHi4i2U mFbP6o7kAcZmZKw6qw+k3k3mD1Q5ubfGx1juz2FZ4Xyc0ThRYXSJtWii71NguTc9iaxb 0+YQ== 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=liTjfFppRgxH2B1xMPIbh7DXSSyVnE1QBWSuAFzG67I=; b=0mx7UFAjZ62v0YcXDGN6F9E2OgXOTjd4wiR9r7Rh4AqH1yxF3WZSmqBwYcTvsxaKL1 WWQk9zESOA1TdsuRllomwGiBMM9TsxReC89RYiTZdLynvW/jHTHxbed9ffIDOa9g7CST 9g+FhB0RA+3sj1+QYnM1MVn1rq3uJFGwS2nKegj9fYuPQwGoLjlVWRApynYB6Y9bZ6yp Tr79sKnNI4GMkOHh2/SE520V5zPNsSctma4rIhr4t1EDusZdvSPdCRuYN/zKfD6Z/vMQ 5V0tav6y0CZd1yb8Rp2/KbgyBD7H7UJbtjrmfxZ1gywn6vedpVtBq9H/AE2RvlQGIkii WUNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BHltiM7L; 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=fail (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 e16si15038243ejl.531.2020.08.17.15.35.10; Mon, 17 Aug 2020 15:35:33 -0700 (PDT) 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=@kernel.org header.s=default header.b=BHltiM7L; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731404AbgHQRTq (ORCPT + 99 others); Mon, 17 Aug 2020 13:19:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:54148 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731080AbgHQQQB (ORCPT ); Mon, 17 Aug 2020 12:16:01 -0400 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 8C60A20658; Mon, 17 Aug 2020 16:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680942; bh=OtTp3PyblAUp8Wp+dnJEmCKgocH/UUyepd5ozcYHdiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BHltiM7LoZAAaRUnZuTl+pn5quMKxjQ9GT5WQV0KCqNAz7w0qbbFnSNfiNHeUVhPt c70qjJg0lzCGoPNof+lyTafJuVxLcy/tZzeziB2ntokyFEYEo9zknM+XMkrVV2noYL +q2/OjgahVjSVUrrs0TSexo8nCNCdPTC99CcZ3fc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 119/168] net: spider_net: Fix the size used in a dma_free_coherent() call Date: Mon, 17 Aug 2020 17:17:30 +0200 Message-Id: <20200817143739.620295702@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143733.692105228@linuxfoundation.org> References: <20200817143733.692105228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 36f28f7687a9ce665479cce5d64ce7afaa9e77ae ] Update the size used in 'dma_free_coherent()' in order to match the one used in the corresponding 'dma_alloc_coherent()', in 'spider_net_init_chain()'. Fixes: d4ed8f8d1fb7 ("Spidernet DMA coalescing") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/toshiba/spider_net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c index 23417266b7ecc..e66014e0427f7 100644 --- a/drivers/net/ethernet/toshiba/spider_net.c +++ b/drivers/net/ethernet/toshiba/spider_net.c @@ -296,8 +296,8 @@ spider_net_free_chain(struct spider_net_card *card, descr = descr->next; } while (descr != chain->ring); - dma_free_coherent(&card->pdev->dev, chain->num_desc, - chain->hwring, chain->dma_addr); + dma_free_coherent(&card->pdev->dev, chain->num_desc * sizeof(struct spider_net_hw_descr), + chain->hwring, chain->dma_addr); } /** -- 2.25.1