Commit 05e1d606 authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

OMAP: DSS2: check for manager when enabling display



None of the DSS interface drivers check if an overlay manager is
connected to the display when the display is being enabled. This leads
to null pointer crash if the display has no manager.

This patch checks for the manager and returns an error if it is null.

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 79e4424f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -176,6 +176,11 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
{
	int r;

	if (dssdev->manager == NULL) {
		DSSERR("failed to enable display: no manager\n");
		return -ENODEV;
	}

	r = omap_dss_start_device(dssdev);
	if (r) {
		DSSERR("failed to start device\n");
+6 −0
Original line number Diff line number Diff line
@@ -4211,6 +4211,12 @@ int omapdss_dsi_display_enable(struct omap_dss_device *dssdev)

	mutex_lock(&dsi->lock);

	if (dssdev->manager == NULL) {
		DSSERR("failed to enable display: no manager\n");
		r = -ENODEV;
		goto err_start_dev;
	}

	r = omap_dss_start_device(dssdev);
	if (r) {
		DSSERR("failed to start device\n");
+6 −0
Original line number Diff line number Diff line
@@ -1231,6 +1231,12 @@ int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)

	mutex_lock(&hdmi.lock);

	if (dssdev->manager == NULL) {
		DSSERR("failed to enable display: no manager\n");
		r = -ENODEV;
		goto err0;
	}

	r = omap_dss_start_device(dssdev);
	if (r) {
		DSSERR("failed to start device\n");
+5 −0
Original line number Diff line number Diff line
@@ -860,6 +860,11 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
{
	int r;

	if (dssdev->manager == NULL) {
		DSSERR("failed to enable display: no manager\n");
		return -ENODEV;
	}

	r = rfbi_runtime_get();
	if (r)
		return r;
+5 −0
Original line number Diff line number Diff line
@@ -55,6 +55,11 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
	unsigned long pck;
	int r;

	if (dssdev->manager == NULL) {
		DSSERR("failed to enable display: no manager\n");
		return -ENODEV;
	}

	r = omap_dss_start_device(dssdev);
	if (r) {
		DSSERR("failed to start device\n");