]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/edid: add single point of return to drm_do_get_edid()
authorJani Nikula <jani.nikula@intel.com>
Mon, 11 Apr 2022 14:00:34 +0000 (17:00 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 14 Apr 2022 13:51:58 +0000 (16:51 +0300)
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
drivers/gpu/drm/drm_edid.c

index c50b2768d5d136e3d2eaf10a6d9da66cbf6ae93d..d2e1c101575d465c93e4c1cd2b4f5effe0c09540 100644 (file)
@@ -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;
 }