Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1235100pxa; Thu, 20 Aug 2020 06:22:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDMvddvtSr+7LumOAvqPJccZfv7IbPsRAyiFjY93kFuiSjBZiDUHrUlvJrnR7Uhvsx7E+p X-Received: by 2002:a17:906:b2c3:: with SMTP id cf3mr3382700ejb.387.1597929758229; Thu, 20 Aug 2020 06:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597929758; cv=none; d=google.com; s=arc-20160816; b=uVBZ4KvUweGtc33AZbXmYY5gKFZYe5PdusINplmbQcEOMtJL+x5ZKNV39gQvIcl3Ho VJKM+yfLS2iL40eNQ+TDr4nLlU0LYK79E6bMDxXMdfqAmM5nSbkdEZzsabZw9Arv+loB Pbr4JMxht6bWdd4FqjXRpo7gbnqp+RdxldA8mK2sBnwmkYiJBo5lWJSbYzeftzRkezCJ 1nTbI32rXjv05fWrbKXC5c/HOWLASV/jmeJQj36ubWXwCsZGNheswtsGWB+E6ADotloe gdPAKNSZ3i/xgW29rDpNw7GG/Ql6z+9lfM7xudU+KSMOH7Eg4F9fL6+mBq5FXu6xwzPX 6+ew== 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=LQ7pH87qgWc5Q3uAVDWLjEQTn86cIk65wP5j7eKrJnU=; b=IM/ANBK9vWflxrgi+VET/t9+syPk/EQK1fJRZ0ftY/vsc+luEQoeAaAe25EY6el0ZP 4mi4owATrutyXjxip4vNt/ujffc98dMbFGc3KlqQaWh0uGZQiARhepZhC81d9oVuhpJC e88ZSuMDyfc8XsPeQ8ScZZQtRp6HG/och2WDzKNENSNlnk/AdmHAUCeTLMom6E0CmQhd xPZqyfNgcRwH5JWHorvIKP/x2ncXJUU++/5U1UGBAOytB5N+QkCm9Iec42RYuAJ9qRR+ 7ZUuFLVU2GZekvXKt3xFgKlI/DDhLaq9hsGRrU/pWajpndaG1nblCE+s9aWjDNTsLaLi u+2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t5PbpWUY; 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 f1si1358530edq.182.2020.08.20.06.22.12; Thu, 20 Aug 2020 06:22:38 -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=t5PbpWUY; 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 S1730057AbgHTNVC (ORCPT + 99 others); Thu, 20 Aug 2020 09:21:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:47464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728351AbgHTJeb (ORCPT ); Thu, 20 Aug 2020 05:34:31 -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 8E9E322BEA; Thu, 20 Aug 2020 09:34:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597916071; bh=Bgf8F92t/ZAyenynqhNM6Yf/xAbcyUQKG4+V7kmmPnQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t5PbpWUY2le1NK1YBc/6chte1IH2ZYZI2zdg6x5NDM1ny5ohFBBNGM8TarelkpX52 fuEznH+mUSCmhOvYRRsXppdBPUn+Lp4/mfIYwXzOjR7pe8hApl+jG+FxBPOKaEA7FY 1vdVqHebH7KFBRm35/+vnuH6xVahb6bnps2gUo5M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Denis Efremov , Steven Price Subject: [PATCH 5.8 222/232] drm/panfrost: Use kvfree() to free bo->sgts Date: Thu, 20 Aug 2020 11:21:13 +0200 Message-Id: <20200820091623.534224121@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@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: Denis Efremov commit 114427b8927a4def2942b2b886f7e4aeae289ccb upstream. Use kvfree() to free bo->sgts, because the memory is allocated with kvmalloc_array() in panfrost_mmu_map_fault_addr(). Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") Cc: stable@vger.kernel.org Signed-off-by: Denis Efremov Reviewed-by: Steven Price Signed-off-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20200608151728.234026-1-efremov@linux.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/panfrost/panfrost_gem.c | 2 +- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/panfrost/panfrost_gem.c +++ b/drivers/gpu/drm/panfrost/panfrost_gem.c @@ -46,7 +46,7 @@ static void panfrost_gem_free_object(str sg_free_table(&bo->sgts[i]); } } - kfree(bo->sgts); + kvfree(bo->sgts); } drm_gem_shmem_free_object(obj); --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -486,7 +486,7 @@ static int panfrost_mmu_map_fault_addr(s pages = kvmalloc_array(bo->base.base.size >> PAGE_SHIFT, sizeof(struct page *), GFP_KERNEL | __GFP_ZERO); if (!pages) { - kfree(bo->sgts); + kvfree(bo->sgts); bo->sgts = NULL; mutex_unlock(&bo->base.pages_lock); ret = -ENOMEM;