omap: fix compiler warning
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Mon, 2 Apr 2012 16:08:29 +0000 (18:08 +0200)
committerRob Clark <rob@ti.com>
Tue, 3 Apr 2012 21:47:48 +0000 (16:47 -0500)
When compiling with linaro toolchain version 4.6.2 got this warning.

  CC     omap_drm.lo
omap_drm.c: In function 'omap_bo_new_impl':
omap_drm.c:139:6: warning: 'bo' may be used uninitialized in this function [-Wuninitialized]

This patch initialize bo to NULL avoiding the warning.

Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Signed-off-by: Rob Clark <rob@ti.com>
omap/omap_drm.c

index e611806..96e1871 100644 (file)
@@ -102,7 +102,7 @@ int omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value)
 static struct omap_bo * omap_bo_new_impl(struct omap_device *dev,
                union omap_gem_size size, uint32_t flags)
 {
-       struct omap_bo *bo;
+       struct omap_bo *bo = NULL;
        struct drm_omap_gem_new req = {
                        .size = size,
                        .flags = flags,