On 6/30/26 23:49, Jonathan Cavitt wrote:
> We should use sizeof(*chains) instead of sizeof(void *) when performing
> the kmalloc for chains in drm_syncobj_timeline_signal_ioctl,
> stylistically speaking.  Also, wrap the line to match how the variable
> points is allocated.
> 
> Concern caught by static analysis.
> 
> Signed-off-by: Jonathan Cavitt <[email protected]>
> Cc: Tobias Hector <[email protected]>
> Cc: Jason Ekstrand <[email protected]>
> Cc: Dave Airlie <[email protected]>
> Cc: Chris Wilson <[email protected]>
> Cc: Christian König <[email protected]>
> Cc: Chunming Zhou <[email protected]>
> Cc: Lionel Landwerlin <[email protected]>
> ---
>  drivers/gpu/drm/drm_syncobj.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index c9dbf64c0c9f..d4c5b97403ee 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -1619,7 +1619,8 @@ drm_syncobj_timeline_signal_ioctl(struct drm_device 
> *dev, void *data,
>               goto err_points;
>       }
>  
> -     chains = kmalloc_array(args->count_handles, sizeof(void *), GFP_KERNEL);
> +     chains = kmalloc_array(args->count_handles, sizeof(*chains),
> +                            GFP_KERNEL);

We should probably use kmalloc_objs() instead here.

Regards,
Christian.


>       if (!chains) {
>               ret = -ENOMEM;
>               goto err_points;

Reply via email to