Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp267116pxx; Wed, 28 Oct 2020 04:32:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw05aurpAT/t+AHp/j8M+oCHQipXsV7Zt/4xStQsvTvmUmYrGSY+GwVh08klbbXh9MSx0bF X-Received: by 2002:a50:8426:: with SMTP id 35mr7214635edp.156.1603884772864; Wed, 28 Oct 2020 04:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884772; cv=none; d=google.com; s=arc-20160816; b=obC+CVNUKiIJuHAyGnJhSBOyfy1D8dZ/yVW3PVRZL6/NwENpkCwcXdy3+j/AL7eJZY 2aJuxlHJMrplqcNJpQHixfbYkNDRtnL2dPmUl5DgHnpoPuaTnh8uzHsaM+hDK41tnljd ESyGOwWsZsc1MxGbPUGBvLruyTtMzj8sNemcC6ylEcTmSvto4op8oh/nko9w8EpQVrGg /d52L004wASpGvLK/hoi9qZqxRsHZElVC8Nu1ae2ahXvbYsct/ZOb3RsWcnMZ7S4iM21 Verp4sg7VURM1Vrps04BtWN/uXCjiVi3fwTyAokuC9LFml8/m2z48R6XB1NyY+vDebFb riZA== 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=nM8JxO8mMX+z4e7GOFR3bbtJ46rBPLsx5ZkcFovPHs4=; b=YWUJCz2475fTekK24TODBYPbdKLnjtY6DvATthxpXR2iMGxa+DQfGaqWdBQlr8IMXi 397cPX99PLmOvh6yhXOXiBG+iOsPtLXgQ/08MQgkDshc+XLxpPi2sXaQwD5JTWRQ/8Dn WU+50FQbAYPc8uL/R9OQyyobkdRj7gkNd34wKj3J3Dm4NkCnW2VHxzXZH9gUOJ4yucj5 BUT/S4urXhsWlOBDzDkVs5TyGILINS1rRDNes9wGhQ2EYUFaY8kADTrC102ISVoNpI9a Q9h5yUCmcZcC4HxFcKzINpRX+ItIP29uuKtvvu6tNUlnIW7w7qz43j5t//wWZaZXFyKf KLZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2VEzJPUH; 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 lg14si2653130ejb.82.2020.10.28.04.32.31; Wed, 28 Oct 2020 04:32:52 -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=2VEzJPUH; 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 S1793831AbgJ0PId (ORCPT + 99 others); Tue, 27 Oct 2020 11:08:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:38128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1790054AbgJ0PDk (ORCPT ); Tue, 27 Oct 2020 11:03:40 -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 9189B206E5; Tue, 27 Oct 2020 15:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811020; bh=ozxkbFFenR9Y7zzU2twX5o755Tjx9+u4UuqQpLoXqVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2VEzJPUHYUqY9XXDVtgziP8lKlQYltaez3qQNupchc8jXAOArvN5kusCNU90IM5Ii X86DBL+EPUnG0EvmFtXcShmXy1bA/zFyVtLWZo+O77JcVdK24eV/Zzarb9Qdo10cdw 5/pumsmgzrhHwH9reSzrbLDhs/pY5vsRaY2wgNRM= 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.8 314/633] net: korina: fix kfree of rx/tx descriptor array Date: Tue, 27 Oct 2020 14:50:57 +0100 Message-Id: <20201027135537.406884535@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 03e034918d147..af441d699a57a 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