Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b2c22bf authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Maxime Ripard
Browse files

drm/sun4i: Add end of list element for sun4i_layers_init's returned list



The number of defined planes in sun4i_layer is unknown to other parts
of the sun4i drm driver. Since the return value of sun4i_layers_init
is a list of layers, make it return 1 more empty layer as an end of
list guard value.

Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
parent 75448607
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -139,7 +139,7 @@ struct sun4i_layer **sun4i_layers_init(struct drm_device *drm)
	struct sun4i_layer **layers;
	struct sun4i_layer **layers;
	int i;
	int i;


	layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes),
	layers = devm_kcalloc(drm->dev, ARRAY_SIZE(sun4i_backend_planes) + 1,
			      sizeof(*layers), GFP_KERNEL);
			      sizeof(*layers), GFP_KERNEL);
	if (!layers)
	if (!layers)
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);