From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D78C2F24 for ; Wed, 12 Apr 2023 08:44:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA827C433EF; Wed, 12 Apr 2023 08:44:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1681289093; bh=vdzjwGx0crus/MrqMWbowkFJ+jXWtZeht3nOZLLVkbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pu3a+ZDlXs2WoUlaa1MBEJYBPjUV7jBUKIG6ayqt7Z/v8i9lMofqACK2zPGGcsVhT G24AKNooQ52togpmKNAoEPy2sSWhftUe7gF6BMVVRq6q/xo2a6eCITZi6QtQaBZdMw WEXusAgBDpXg+DXHS3zA4J3JjGuWPBWy48+2R0wk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tomeu Vizoso , Boris Brezillon , Steven Price Subject: [PATCH 6.1 133/164] drm/panfrost: Fix the panfrost_mmu_map_fault_addr() error path Date: Wed, 12 Apr 2023 10:34:15 +0200 Message-Id: <20230412082842.257820042@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230412082836.695875037@linuxfoundation.org> References: <20230412082836.695875037@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Boris Brezillon commit 764a2ab9eb56e1200083e771aab16186836edf1d upstream. Make sure all bo->base.pages entries are either NULL or pointing to a valid page before calling drm_gem_shmem_put_pages(). Reported-by: Tomeu Vizoso Cc: Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Link: https://patchwork.freedesktop.org/patch/msgid/20210521093811.1018992-1-boris.brezillon@collabora.com Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -504,6 +504,7 @@ static int panfrost_mmu_map_fault_addr(s if (IS_ERR(pages[i])) { mutex_unlock(&bo->base.pages_lock); ret = PTR_ERR(pages[i]); + pages[i] = NULL; goto err_pages; } }