From: Boris Brezillon <boris.brezillon@collabora.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Steven Price <steven.price@arm.com>,
Liviu Dudau <liviu.dudau@arm.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Grant Likely <grant.likely@linaro.org>,
Heiko Stuebner <heiko@sntech.de>,
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
Date: Wed, 3 Apr 2024 09:16:02 +0200 [thread overview]
Message-ID: <20240403091602.52e887b3@collabora.com> (raw)
In-Reply-To: <cf5bbba5-427e-4940-b91e-925f9fa71f8d@moroto.mountain>
On Tue, 2 Apr 2024 12:58:09 +0300
Dan Carpenter <dan.carpenter@linaro.org> 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 <dan.carpenter@linaro.org>
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);
prev parent reply other threads:[~2024-04-03 7:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 9:58 [PATCH] drm/panthor: Fix a couple -ENOMEM error codes Dan Carpenter
2024-04-02 12:21 ` Boris Brezillon
2024-04-03 7:16 ` Boris Brezillon [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240403091602.52e887b3@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=airlied@gmail.com \
--cc=dan.carpenter@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=grant.likely@linaro.org \
--cc=heiko@sntech.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liviu.dudau@arm.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=steven.price@arm.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox