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 07B31CD1284 for ; Tue, 2 Apr 2024 12:21:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32CBA10FCD5; Tue, 2 Apr 2024 12:21:50 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="qK5BPooC"; dkim-atps=neutral Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) by gabe.freedesktop.org (Postfix) with ESMTPS id 84C8D10FCD5 for ; Tue, 2 Apr 2024 12:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1712060508; bh=7SXXtWFFK3yJiK34x7w4K4HBICcMgAm0cuEQJNBk8zk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=qK5BPooCkBTx/paRFFHqxxAzlajZdrTTdIIQYVqoOWIJGP9uL2nxbav/2zGeR9yur ePCLBQjf0JEeorEIryqKNOy2Vw0sG3eZjAziCea2Chx1GnPFTAhO6Vvtqfi54OFqYr z0SK7Iy99E7crqg08txt7caUB1nqnsumKyqI8afIrW/pUH3BJ8UpF2KYF/jbUCPyIK qt4rH0lXbAX3cnEMoi61bsgSM1qQGHm4ihQl0wULPu+ntuztrdpIDlww/ArzkXv7Uj U/Lqd75k/0S8+Rr/+86CENrigOYIySEKr6cn8w1V7/xGAskag1YYUfmGOSGF2AXiV4 XiENTbu4PwHLw== 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 7E34E3781144; Tue, 2 Apr 2024 12:21:47 +0000 (UTC) Date: Tue, 2 Apr 2024 14:21:46 +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: <20240402142146.58a438c9@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 Reviewed-by: Boris Brezillon > --- > 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);