Re: [PATCH] drm/i915: Quieten compiler warning for ctch_open()

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

 



On Sat, Jun 03, 2017 at 06:58:42PM +0100, Chris Wilson wrote:
> Quoting Chris Wilson (2017-06-03 18:50:02)
> > Sparse sees that vma may be NULL, but doesn't realise that the
> 
> s/sparse/smatch/
> 
> > constructor will set vma or flag an error. Give is a BUG_ON so it knows
> > that vma is non-NULL afterwards.
> > 
> > drivers/gpu/drm/i915/intel_guc_ct.c:204 ctch_open() error: we previously
> > assumed 'ctch->vma' could be null (see line 197)
> > 
> > Fixes: f8a58d639dd9 ("drm/i915/guc: Introduce buffer based cmd transport")
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
> > Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@xxxxxxxxx>
> > Cc: Oscar Mateo <oscar.mateo@xxxxxxxxx>
> > Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/intel_guc_ct.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_guc_ct.c b/drivers/gpu/drm/i915/intel_guc_ct.c
> > index c4cbec140101..49ccf9090641 100644
> > --- a/drivers/gpu/drm/i915/intel_guc_ct.c
> > +++ b/drivers/gpu/drm/i915/intel_guc_ct.c
> > @@ -199,6 +199,7 @@ static int ctch_open(struct intel_guc *guc,
> >                 if (unlikely(err))
> >                         goto err_out;
> >         }
> > +       GEM_BUG_ON(!ctch->vma);

Same false positive was also detected by our tool, but I wasn't sure how to
quiet it without introducing extra code. Thanks for the fix!

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>


> >  
> >         /* vma should be already allocated and map'ed */
> >         base = guc_ggtt_offset(ctch->vma);
> > -- 
> > 2.11.0
> > 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux