mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
drm/edid: add single point of return to drm_do_get_edid()
This will be useful in the future. Use fail label for fail exit. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/8e564e9415baa4dc9dc3127e4200b2618a8a3ba0.1649685475.git.jani.nikula@intel.com
This commit is contained in:
parent
b3eb97b66d
commit
1c788f69f2
1 changed files with 8 additions and 7 deletions
|
@ -2106,7 +2106,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
|
|||
|
||||
edid = drm_get_override_edid(connector);
|
||||
if (edid)
|
||||
return edid;
|
||||
goto ok;
|
||||
|
||||
edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
|
||||
if (!edid)
|
||||
|
@ -2117,7 +2117,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
|
|||
edid_block_status_print(status, edid, 0);
|
||||
|
||||
if (status == EDID_BLOCK_READ_FAIL)
|
||||
goto out;
|
||||
goto fail;
|
||||
|
||||
/* FIXME: Clarify what a corrupt EDID actually means. */
|
||||
if (status == EDID_BLOCK_OK || status == EDID_BLOCK_VERSION)
|
||||
|
@ -2130,15 +2130,15 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
|
|||
connector->null_edid_counter++;
|
||||
|
||||
connector_bad_edid(connector, edid, 1);
|
||||
goto out;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (edid->extensions == 0)
|
||||
return edid;
|
||||
goto ok;
|
||||
|
||||
new = krealloc(edid, (edid->extensions + 1) * EDID_LENGTH, GFP_KERNEL);
|
||||
if (!new)
|
||||
goto out;
|
||||
goto fail;
|
||||
edid = new;
|
||||
|
||||
for (j = 1; j <= edid->extensions; j++) {
|
||||
|
@ -2150,7 +2150,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
|
|||
|
||||
if (!edid_block_status_valid(status, edid_block_tag(block))) {
|
||||
if (status == EDID_BLOCK_READ_FAIL)
|
||||
goto out;
|
||||
goto fail;
|
||||
invalid_blocks++;
|
||||
}
|
||||
}
|
||||
|
@ -2161,9 +2161,10 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
|
|||
edid = edid_filter_invalid_blocks(edid, invalid_blocks);
|
||||
}
|
||||
|
||||
ok:
|
||||
return edid;
|
||||
|
||||
out:
|
||||
fail:
|
||||
kfree(edid);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue