drm/i915/guc: Assert ctch->vma is allocated
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 6 Nov 2017 13:51:54 +0000 (13:51 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 6 Nov 2017 13:57:37 +0000 (13:57 +0000)
Silence smatch by demonstrating that ctch->vma is allocated
following a successful chch_init()

drivers/gpu/drm/i915/intel_guc_ct.c:204 ctch_open() error:
 we previously assumed 'ctch->vma' could be null (see line 197)

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171106135154.52520-1-michal.wajdeczko@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_guc_ct.c

index c4cbec140101b380b093f08b66759f00fb5ba06a..24ad55752396515681f964db1eb2ae0f8bbbde5d 100644 (file)
@@ -198,6 +198,7 @@ static int ctch_open(struct intel_guc *guc,
                err = ctch_init(guc, ctch);
                if (unlikely(err))
                        goto err_out;
+               GEM_BUG_ON(!ctch->vma);
        }
 
        /* vma should be already allocated and map'ed */