Message ID | 1379075614-20491-1-git-send-email-prarit@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Sep 13, 2013 at 8:33 AM, Prarit Bhargava <prarit@redhat.com> wrote: > Fix uninitialized warning. > > drivers/gpu/drm/ttm/ttm_object.c: In function ‘ttm_base_object_lookup’: > drivers/gpu/drm/ttm/ttm_object.c:213:10: error: ‘base’ may be used uninitialized in this function [-Werror=maybe-uninitialized] > kref_put(&base->refcount, ttm_release_base); > ^ > drivers/gpu/drm/ttm/ttm_object.c:221:26: note: ‘base’ was declared here > struct ttm_base_object *base; > > Signed-off-by: Prarit Bhargava <prarit@redhat.com> > Cc: David Airlie <airlied@linux.ie> > Cc: rclark@redhat.com Reviewed-by: Rob Clark <robdclark@gmail.com> > --- > drivers/gpu/drm/ttm/ttm_object.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_object.c b/drivers/gpu/drm/ttm/ttm_object.c > index 58a5f32..a868176 100644 > --- a/drivers/gpu/drm/ttm/ttm_object.c > +++ b/drivers/gpu/drm/ttm/ttm_object.c > @@ -218,7 +218,7 @@ struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file *tfile, > uint32_t key) > { > struct ttm_object_device *tdev = tfile->tdev; > - struct ttm_base_object *base; > + struct ttm_base_object *uninitialized_var(base); > struct drm_hash_item *hash; > int ret; > > -- > 1.7.9.3 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff --git a/drivers/gpu/drm/ttm/ttm_object.c b/drivers/gpu/drm/ttm/ttm_object.c index 58a5f32..a868176 100644 --- a/drivers/gpu/drm/ttm/ttm_object.c +++ b/drivers/gpu/drm/ttm/ttm_object.c @@ -218,7 +218,7 @@ struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file *tfile, uint32_t key) { struct ttm_object_device *tdev = tfile->tdev; - struct ttm_base_object *base; + struct ttm_base_object *uninitialized_var(base); struct drm_hash_item *hash; int ret;
Fix uninitialized warning. drivers/gpu/drm/ttm/ttm_object.c: In function ‘ttm_base_object_lookup’: drivers/gpu/drm/ttm/ttm_object.c:213:10: error: ‘base’ may be used uninitialized in this function [-Werror=maybe-uninitialized] kref_put(&base->refcount, ttm_release_base); ^ drivers/gpu/drm/ttm/ttm_object.c:221:26: note: ‘base’ was declared here struct ttm_base_object *base; Signed-off-by: Prarit Bhargava <prarit@redhat.com> Cc: David Airlie <airlied@linux.ie> Cc: rclark@redhat.com --- drivers/gpu/drm/ttm/ttm_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)