drm/sun4i: Save newly created layer in layers array in sun4i_layers_init
authorChen-Yu Tsai <wens@csie.org>
Fri, 17 Feb 2017 03:13:29 +0000 (11:13 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 7 Mar 2017 21:15:15 +0000 (22:15 +0100)
sun4i_layers_init allocates an array to store pointers to newly created
layers returned by sun4i_layer_init_one(), but fails to actually store
them. But it actually returns the empty array to unsuspecting users.

Save the pointers in the array, so that they may be used later.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/gpu/drm/sun4i/sun4i_layer.c

index 92ecc967dcb1e92383ef1b96a5f38b7b2afef345..41bc0f860f5c0d68be8c719adfb112066e5d8af9 100644 (file)
@@ -183,6 +183,7 @@ struct sun4i_layer **sun4i_layers_init(struct drm_device *drm)
                                   SUN4I_BACKEND_ATTCTL_REG0_LAY_PIPESEL(plane->pipe));
 
                layer->id = i;
+               layers[i] = layer;
        };
 
        return layers;