Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp162216pxx; Wed, 28 Oct 2020 01:11:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqF7bN9Co/SPIL5+/OMeozH1sx4ci1vmxeLCaZacLfBRFrQi7fE7h552LgqW8KF2MbULWw X-Received: by 2002:a17:906:cc18:: with SMTP id ml24mr6105569ejb.298.1603872683677; Wed, 28 Oct 2020 01:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872683; cv=none; d=google.com; s=arc-20160816; b=NtDF1QKDKs9t4CntMcGKjbLzXdoeSxHcEYfylatxTGbZ7vFEJQtW+iH7/oCj2zDgWw SI20ajMXpz0dvqAvv+QMGfVdbklmcsQ96y6EgPMU7V61DLWu+f56AcBjpJYYQGyjeyf1 pF3q85zjo1BgRe4p2KsjzNMZARzHsRrW+V4rS27zQDjjhL6zWuyFbAyMSi4LTWbo92i+ W2jub462NVU3jrE+MbIxcqNq0/xyLyc/F5m5Wd4hCo0n73i3I97ktH8aEW/Hx4voCs50 /8+MM9S6nOCn4nVoJhqT2nn5GAlfkhN6SG7DpdSX+muZARH/lDP21b2mk9SLPBX1TEld qa4Q== 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=/MmAW6hiUN1awupaogkkoLHEIKL9czhvIBnNcXwgtg8=; b=NVZoTpgguP6iwGw4HwVPrnAJ0YOdOBYzFOJb2a/8m0Hpc5bVVphv0x0UuHzC9iUrfG ZxWS7xavYgWDFjz8ENsLzELZeg3QOdDzEBG1WjneisW95shYMfDZG+3uIa7GyuYfeVxO AFcwa63bskKha84O4PKkzTiafDdWmYjgIVVjL6tcX4y1/Tnfn4YZGDS6BzuUR3QKkwFc RBDYv4SH9zJ45x9X6tScWFaQFRPnD3oo39JHcslAoiKYsUPD3jnatcPm4JNEMO5cvNr6 ahtHKMaiWlpJ3uQNE96gGtTogVkBUXb14Ebs7hq/neQf41ShvRGLUi/E8bwdaRZCLNnO NsdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ftoi4rDW; 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 w11si2719069ejq.533.2020.10.28.01.11.01; Wed, 28 Oct 2020 01:11:23 -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=Ftoi4rDW; 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 S1753169AbgJ0N6y (ORCPT + 99 others); Tue, 27 Oct 2020 09:58:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:46158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753150AbgJ0N6r (ORCPT ); Tue, 27 Oct 2020 09:58:47 -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 B52A3206D4; Tue, 27 Oct 2020 13:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807127; bh=8B3owS/e2tltkU8ks4r/tsVhfXZQXWtNInk5utamHEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ftoi4rDWKkZvI3H2Tj9bg1hjkPKTolfpd6ipBLEXQE4j6Lc3iv/W6nfdwbGc4vMX3 QMN5j9rOpQwVqAMROxsTW8bE2kbAN9n8H58rEbhqbzoWURTjHEmM488t5UC13fZBSv O7vXY/2IUVCKaVw7NqoAiHjLxVbBZgobeigh90V8= 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 4.4 052/112] net: korina: fix kfree of rx/tx descriptor array Date: Tue, 27 Oct 2020 14:49:22 +0100 Message-Id: <20201027134903.030935110@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 07eabf72c480c..3954c80f70fcb 100644 --- a/drivers/net/ethernet/korina.c +++ b/drivers/net/ethernet/korina.c @@ -1188,7 +1188,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: @@ -1208,6 +1208,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