From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9081CC6FD1F for ; Wed, 3 Apr 2024 07:16:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2B2B11213B; Wed, 3 Apr 2024 07:16:07 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="IRwv3E0S"; dkim-atps=neutral Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id ADDAA11213B for ; Wed, 3 Apr 2024 07:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712128564; bh=lPEY9LAq6rCazZ/wYlUXoq5Wg9ti2sF5LYYoNELnQPI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IRwv3E0SZFUeFmQ8eJY2qltl5wtndpp2A7fMPHVx3hSqmBYPDqifOE2Oos81fcLxz 5flzyqrtCeOWJPs2JymYu9Letwf7lZF0ryY0OjGcGkuCgRyt2BRhEiki1VNmF40MXe NkimKeRKo5rlerauUOuAtrfvvCGh/9FdLwD3CI+d5eL22MuvSUG9F3GCoek/D2D60c fze0MuEZ1GZO6UKsku0AehTcoLmVWftu0NyIOBKrbtLsuYaA8mrLRIw89Jsq0bJY1b fpk4COw6Tv4E4eUt8wYk2umfWClmi5L7shJtdTTF2ald0LIhoBWc+RdWoTKstMLzbJ Qbiklu9CtWOGg== Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madrid.collaboradmins.com (Postfix) with ESMTPSA id ACC3F37813DC; Wed, 3 Apr 2024 07:16:03 +0000 (UTC) Date: Wed, 3 Apr 2024 09:16:02 +0200 From: Boris Brezillon To: Dan Carpenter Cc: Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Grant Likely , Heiko Stuebner , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] drm/panthor: Fix a couple -ENOMEM error codes Message-ID: <20240403091602.52e887b3@collabora.com> In-Reply-To: References: Organization: Collabora X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 2 Apr 2024 12:58:09 +0300 Dan Carpenter wrote: > These error paths forgot to set the error code to -ENOMEM. > > Fixes: 647810ec2476 ("drm/panthor: Add the MMU/VM logical block") > Signed-off-by: Dan Carpenter Queued to drm-misc-next. Thanks, Boris > --- > drivers/gpu/drm/panthor/panthor_mmu.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c > index fdd35249169f..a26b40aab261 100644 > --- a/drivers/gpu/drm/panthor/panthor_mmu.c > +++ b/drivers/gpu/drm/panthor/panthor_mmu.c > @@ -1264,8 +1264,10 @@ static int panthor_vm_prepare_map_op_ctx(struct panthor_vm_op_ctx *op_ctx, > op_ctx->rsvd_page_tables.pages = kcalloc(pt_count, > sizeof(*op_ctx->rsvd_page_tables.pages), > GFP_KERNEL); > - if (!op_ctx->rsvd_page_tables.pages) > + if (!op_ctx->rsvd_page_tables.pages) { > + ret = -ENOMEM; > goto err_cleanup; > + } > > ret = kmem_cache_alloc_bulk(pt_cache, GFP_KERNEL, pt_count, > op_ctx->rsvd_page_tables.pages); > @@ -1318,8 +1320,10 @@ static int panthor_vm_prepare_unmap_op_ctx(struct panthor_vm_op_ctx *op_ctx, > op_ctx->rsvd_page_tables.pages = kcalloc(pt_count, > sizeof(*op_ctx->rsvd_page_tables.pages), > GFP_KERNEL); > - if (!op_ctx->rsvd_page_tables.pages) > + if (!op_ctx->rsvd_page_tables.pages) { > + ret = -ENOMEM; > goto err_cleanup; > + } > > ret = kmem_cache_alloc_bulk(pt_cache, GFP_KERNEL, pt_count, > op_ctx->rsvd_page_tables.pages);