Re: [PATCH] drm/i915: fix application of sizeof to pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 20 Jul 2023, sunran001@xxxxxxxxxx wrote:
> The coccinelle check report:
> ./drivers/scsi/csiostor/csio_mb.c:1554:46-52: ERROR: application
> of sizeof to pointer

Please don't just assume coccinelle is right, and send "fixes" based on
the cocci reports alone. You need to read and understand the code you're
changing.


BR,
Jani.

>
> Signed-off-by: Ran Sun <sunran001@xxxxxxxxxx>
> ---
>   drivers/gpu/drm/i915/i915_syncmap.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_syncmap.c 
> b/drivers/gpu/drm/i915/i915_syncmap.c
> index 60404dbb2e9f..4eeaf12be72d 100644
> --- a/drivers/gpu/drm/i915/i915_syncmap.c
> +++ b/drivers/gpu/drm/i915/i915_syncmap.c
> @@ -282,7 +282,7 @@ static noinline int __sync_set(struct i915_syncmap 
> **root, u64 id, u32 seqno)
>   			unsigned int above;
>
>   			/* Insert a join above the current layer */
> -			next = kzalloc(sizeof(*next) + KSYNCMAP * sizeof(next),
> +			next = kzalloc(sizeof(*next) + KSYNCMAP * sizeof(*next),
>   				       GFP_KERNEL);
>   			if (unlikely(!next))
>   				return -ENOMEM;

-- 
Jani Nikula, Intel Open Source Graphics Center



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux