Re: [PATCH 2/4] Klock work Fix for NULL dereferencing in i915_gem_mman.c

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

 



On 2021-06-28 at 20:08:27 +0530, Bommu Krishnaiah wrote:
> Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@xxxxxxxxx>
> Cc: Abdiel Janulgue <abdiel.janulgue@xxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/gem/i915_gem_mman.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> index a90f796e85c03..cad33cd49ba95 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c
> @@ -961,6 +961,8 @@ int i915_gem_mmap(struct file *filp, struct vm_area_struct *vma)
>  
>  	vma->vm_private_data = mmo;
>  
> +	GEM_BUG_ON(!mmo);
> +
This also looks false positive to me. As mmo is dereferenced only when
the if (!node->driver_private && !obj->ops->mmap_ops)

 when node->driver_private is true but obj->ops->mmap_ops is not true
 then mmo will be NULL. Which is already captured as GEM_BUG_ON(obj && !obj->ops->mmap_ops);

 So we can ignore this too.

 Ram


>  	switch (mmo->mmap_type) {
>  	case I915_MMAP_TYPE_WC:
>  		vma->vm_page_prot =
> -- 
> 2.25.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux