Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1111745pxx; Tue, 27 Oct 2020 08:30:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMtp4Wf+JbdO7VfImulNE8bTOyygN/lSQMWHyxGtn/8noLrURX9SMD0zZNbVuyg4BkyAIv X-Received: by 2002:a17:906:745:: with SMTP id z5mr3134818ejb.408.1603812632978; Tue, 27 Oct 2020 08:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603812632; cv=none; d=google.com; s=arc-20160816; b=AYuHvc7a0KLmG9OKHM38DOyYB/V2g56pTPMI3gyGd8QmBjBngWwmcDcS8aB+6Spv1r 5Cg9kGL8El9vvHv9HITXxc/wt+3I3LPmpWFw4lGXlbuQp1Tf8yhJKP1GMvpLaFke/d0w o4an8jqK43ttAQF+erKYvEesXx7PQOPkzZ8c9aDn//e4hzTHf71ogQiuHNDdHOgAA6Vh RN2QUeV96JwW6mHH0CKSULH8kBFLOtnOggMfjUuZphsjtHXokIq+bZuJyUKt8DGWihq7 rDvMdtQSmlH1wfxuXI//s2azpM0s7oaDIyMzT+2pwJXEGzFY5GDqPcc5/+n3c94gT71D 6Agw== 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=YC4V3u0+9EzNW6hBFBJwcMfrsaCPiUSug3XvQRtBXlE=; b=QtIP3kssQ4hvtg/8zD98xUAeKlICM9IAcAbjbKv1UWtGT1vQlnwQhyuNSfYJiUo55U afpEJFvHqOHWONjKWx6R/nDEFLamAPItZ+jyrX7WNT6gK4U7gYvWHfh1JfOAyoQqUjaO TE732zMWnr+wYnyE4NS770C+jnPP4t5j4A/xJxHnSZG7NZ6zVDJIFOKc0RVojGtcdQhR T/+2jYhi9UGiEbqCIuvTuC5rC1CIEYx9+p1cZSn0ri91O29hvL/NQrXn7TgR1Z4Fj+fm TwqCWT7P/4OPFXnA1sZ4vtr4dcIgS4hFjpGw83GCpbuBzvBEfIDWyWzR08vlpPAPgRtc lVkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KR0snGAW; 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 i23si1538751ejj.284.2020.10.27.08.30.10; Tue, 27 Oct 2020 08:30:32 -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=KR0snGAW; 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 S1761212AbgJ0Oi0 (ORCPT + 99 others); Tue, 27 Oct 2020 10:38:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:37646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761206AbgJ0OiZ (ORCPT ); Tue, 27 Oct 2020 10:38:25 -0400 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 EC7D3207BB; Tue, 27 Oct 2020 14:38:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809504; bh=F8eUBlUZLZfvPMwO1QGBdYgE8jn3qlju0+011V3Bu54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KR0snGAWdYOmRZdV1+mm9kjfwWl6MDV6aJ2OSa8P2p0OSjFTYHGUpGCbYYWu83Agx 2BxjtMH7KUxZLVlt3n/9WbxrDGwlEvRWWc72yRzcXF1dlcvGIe4WnwxFLxCAGSnfFU HL6o1LHUY3VLsqEyDZv6R2EZnxMvbBedgnHKA5Z8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Valentin Vidic , Willem de Bruijn , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 189/408] net: korina: fix kfree of rx/tx descriptor array Date: Tue, 27 Oct 2020 14:52:07 +0100 Message-Id: <20201027135503.857722853@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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: Valentin Vidic [ Upstream commit 3af5f0f5c74ecbaf757ef06c3f80d56751277637 ] kmalloc returns KSEG0 addresses so convert back from KSEG1 in kfree. Also make sure array is freed when the driver is unloaded from the kernel. Fixes: ef11291bcd5f ("Add support the Korina (IDT RC32434) Ethernet MAC") Signed-off-by: Valentin Vidic Acked-by: Willem de Bruijn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/korina.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/korina.c b/drivers/net/ethernet/korina.c index ae195f8adff58..5bdff77c0ad10 100644 --- a/drivers/net/ethernet/korina.c +++ b/drivers/net/ethernet/korina.c @@ -1113,7 +1113,7 @@ static int korina_probe(struct platform_device *pdev) return rc; probe_err_register: - kfree(lp->td_ring); + kfree(KSEG0ADDR(lp->td_ring)); probe_err_td_ring: iounmap(lp->tx_dma_regs); probe_err_dma_tx: @@ -1133,6 +1133,7 @@ static int korina_remove(struct platform_device *pdev) iounmap(lp->eth_regs); iounmap(lp->rx_dma_regs); iounmap(lp->tx_dma_regs); + kfree(KSEG0ADDR(lp->td_ring)); unregister_netdev(bif->dev); free_netdev(bif->dev); -- 2.25.1