drm/rcar-du: Don't ignore rcar_du_crtc_create() return value
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 4 Jul 2013 18:05:50 +0000 (20:05 +0200)
committerDave Airlie <airlied@redhat.com>
Fri, 5 Jul 2013 05:34:56 +0000 (15:34 +1000)
Handle error cases correctly.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/rcar-du/rcar_du_kms.c

index 9c63f39658de82423d16556e5340d746c83f33d2..06cacf6532c05f39314b3afabf5b8a0b26e050fd 100644 (file)
@@ -191,8 +191,11 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
        if (ret < 0)
                return ret;
 
-       for (i = 0; i < ARRAY_SIZE(rcdu->crtcs); ++i)
-               rcar_du_crtc_create(rcdu, i);
+       for (i = 0; i < ARRAY_SIZE(rcdu->crtcs); ++i) {
+               ret = rcar_du_crtc_create(rcdu, i);
+               if (ret < 0)
+                       return ret;
+       }
 
        rcdu->used_crtcs = 0;
        rcdu->num_crtcs = i;