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

Commit e62fb64e authored by Chris Wilson's avatar Chris Wilson Committed by Dave Airlie
Browse files

drm: Check for a NULL encoder when reverting on error path



We need to skip the connectors with a NULL encoder to match the success
path and avoid an OOPS.

Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDave Airlie <airlied@linux.ie>
parent 85a7bb98
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -775,8 +775,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
fail_set_mode:
	set->crtc->enabled = save_enabled;
	count = 0;
	list_for_each_entry(connector, &dev->mode_config.connector_list, head)
	list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
		if (!connector->encoder)
			continue;

		connector->encoder->crtc = save_crtcs[count++];
	}
fail_no_encoder:
	kfree(save_crtcs);
	count = 0;