summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sun4i
diff options
context:
space:
mode:
authorChen-Yu Tsai <wens@csie.org>2017-02-17 06:13:29 +0300
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-03-08 00:15:15 +0300
commit903795d60ffa89918b521064b0cbcba139ae4047 (patch)
tree92f6654f991c8f11dee6588172cff5fd34ae9bef /drivers/gpu/drm/sun4i
parent8a16469b74af0fb584686e5e18d2cf3570424e4b (diff)
downloadlinux-903795d60ffa89918b521064b0cbcba139ae4047.tar.xz
drm/sun4i: Save newly created layer in layers array in sun4i_layers_init
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>
Diffstat (limited to 'drivers/gpu/drm/sun4i')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_layer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.c b/drivers/gpu/drm/sun4i/sun4i_layer.c
index 92ecc967dcb1..41bc0f860f5c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_layer.c
+++ b/drivers/gpu/drm/sun4i/sun4i_layer.c
@@ -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;