From: Liviu Dudau <liviu.dudau@arm.com>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: "Steven Price" <steven.price@arm.com>,
"Adrián Larumbe" <adrian.larumbe@collabora.com>,
dri-devel@lists.freedesktop.org, kernel@collabora.com
Subject: Re: [PATCH 1/2] drm/panthor: Don't check the array stride on empty uobj arrays
Date: Fri, 28 Jun 2024 20:19:15 +0100 [thread overview]
Message-ID: <Zn8Ms3BTY2ybT0fb@e110455-lin.cambridge.arm.com> (raw)
In-Reply-To: <20240628145536.778349-2-boris.brezillon@collabora.com>
On Fri, Jun 28, 2024 at 04:55:35PM +0200, Boris Brezillon wrote:
> The user is likely to leave all the drm_panthor_obj_array fields
> to zero when the array is empty, which will cause an EINVAL failure.
>
> Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/panthor/panthor_drv.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c
> index b8a84f26b3ef..b5e7b919f241 100644
> --- a/drivers/gpu/drm/panthor/panthor_drv.c
> +++ b/drivers/gpu/drm/panthor/panthor_drv.c
> @@ -86,15 +86,15 @@ panthor_get_uobj_array(const struct drm_panthor_obj_array *in, u32 min_stride,
> int ret = 0;
> void *out_alloc;
>
> + if (!in->count)
> + return NULL;
> +
> /* User stride must be at least the minimum object size, otherwise it might
> * lack useful information.
> */
> if (in->stride < min_stride)
> return ERR_PTR(-EINVAL);
>
> - if (!in->count)
> - return NULL;
> -
> out_alloc = kvmalloc_array(in->count, obj_size, GFP_KERNEL);
> if (!out_alloc)
> return ERR_PTR(-ENOMEM);
> --
> 2.45.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
next prev parent reply other threads:[~2024-06-28 19:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-28 14:55 [PATCH 0/2] drm/panthor: Fix support for sync-only jobs Boris Brezillon
2024-06-28 14:55 ` [PATCH 1/2] drm/panthor: Don't check the array stride on empty uobj arrays Boris Brezillon
2024-06-28 19:19 ` Liviu Dudau [this message]
2024-07-01 9:03 ` Steven Price
2024-06-28 14:55 ` [PATCH 2/2] drm/panthor: Fix sync-only jobs Boris Brezillon
2024-06-28 21:34 ` Liviu Dudau
2024-06-29 8:52 ` Boris Brezillon
2024-06-29 12:10 ` Liviu Dudau
2024-07-01 6:59 ` Boris Brezillon
2024-07-01 9:03 ` Steven Price
2024-07-01 11:02 ` kernel test robot
2024-07-02 15:13 ` Boris Brezillon
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=Zn8Ms3BTY2ybT0fb@e110455-lin.cambridge.arm.com \
--to=liviu.dudau@arm.com \
--cc=adrian.larumbe@collabora.com \
--cc=boris.brezillon@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@collabora.com \
--cc=steven.price@arm.com \
/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