Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp4185896ybg; Mon, 8 Jun 2020 01:00:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxquKPAqn/jue4oGwJVNkYD4HliNZiWmqK0ie17CimMZPOkelOII5baRILeHlwfU7gZi9zi X-Received: by 2002:a17:906:ae88:: with SMTP id md8mr20766051ejb.347.1591603253655; Mon, 08 Jun 2020 01:00:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591603253; cv=none; d=google.com; s=arc-20160816; b=uHuoMnvmdZ86yILndWPmDW6NBOUbdq1UafIGodBQHLbW8wJCyEEZyR6dCJ1brhSfLd /DsMPjtn8DTMk98Oz0JEUbRRYPdN3/0BHXsUKUAyYLmJOrrs02rYUQH99f0gorl0whVY /EJpuM45Czy2JPDWRwq7DnUBG3EoJO1yNwOrqQ4ufgu0j3d1WnqBzuvUdxfJRY4eEkcG p19kyKqNzsWE+DYIJZNPiieVOYaIhxa2TLwn1Hgv3IX/w7zvKoOc0U3NCZLNLu4+wPQg 7r5SLCk+3+yll0NGifqjC8GnZ9CgOipva1dQ4moJ2g7fpowZvbEZ/Kb8KBgaTxfSgwGQ ZL7Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=JWKwoEN/ZRTvhhfd0X9xXgydvTYs6Cb0wj8vCHI4JgU=; b=PmDbIyVmlYyUanLuObBWoKwjZ3NemeA9lBqWCqmZlD6hvSb+Zj11g9H6GRHCG+NUe1 TSRas6xwrOO9OmSQcnXkBjq8TXKSp9zUtWtcKTfce135331iHRMT05ARY2TZXFUSDl1w S32YaDFQxsmuOhn1fktpYVJP2R+G8pG7KcXuT8Lz1eJRoMDRjXNLnNw61rKoDtXvkKnw TXqDBFQwU6+lKdnf5REISaPUnIg8cO5JJ//NDAg1lIkowvRFW/TKUTMo1M7LXzR4VJiM Grwibhi9KllG/XMLH/oPm6n/F/kGRgPdLR4aAcjgig4xXHm9OV1Z6tHqTX4nyszYrv7t 6xLw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nr21si8695105ejb.230.2020.06.08.01.00.30; Mon, 08 Jun 2020 01:00:53 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729060AbgFHH43 (ORCPT + 99 others); Mon, 8 Jun 2020 03:56:29 -0400 Received: from foss.arm.com ([217.140.110.172]:49338 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725868AbgFHH42 (ORCPT ); Mon, 8 Jun 2020 03:56:28 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E23111F1; Mon, 8 Jun 2020 00:56:27 -0700 (PDT) Received: from [192.168.1.84] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D19F13F6CF; Mon, 8 Jun 2020 00:56:26 -0700 (PDT) Subject: Re: [PATCH] drm/panfrost: Use kvfree() to free bo->sgts in panfrost_mmu_map_fault_addr() To: Denis Efremov , David Airlie , Daniel Vetter Cc: Rob Herring , Tomeu Vizoso , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20200605185207.76661-1-efremov@linux.com> From: Steven Price Message-ID: <143663fd-59e9-37b9-371d-e15cf35e7374@arm.com> Date: Mon, 8 Jun 2020 08:56:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200605185207.76661-1-efremov@linux.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/06/2020 19:52, Denis Efremov wrote: > Use kvfree() to free bo->sgts, because the memory is allocated with > kvmalloc_array(). > > Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") > Cc: stable@vger.kernel.org > Signed-off-by: Denis Efremov Well spotted, but there's another one in panfrost_gem_free_object(). Please can you fix that at the same time? Thanks, Steve > --- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c > index ed28aeba6d59..3c8ae7411c80 100644 > --- 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(struct panfrost_device *pfdev, int as, > 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; >