diff options
author | James Ausmus <james.ausmus@intel.com> | 2017-10-13 21:01:44 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2017-10-17 18:23:30 +0300 |
commit | 091a4f91942a4396c67e5747f5cb38c6396d1fc5 (patch) | |
tree | 4126a3cef66b1154c15741c1e8d2b2b89a0d256c /drivers/gpu/drm/i915/intel_display.c | |
parent | 134649ff3545f3b7b862c589e9accb400ace2474 (diff) | |
download | linux-091a4f91942a4396c67e5747f5cb38c6396d1fc5.tar.xz |
drm/i915: Handle drm-layer errors in intel_dp_add_mst_connector
Make intel_dp_add_mst_connector handle error returns from the drm_ calls.
Add intel_connector_free to support cleanup on the error path.
v2: Rename new function to avoid confusion, and simplify error
paths (Ville)
v3: Indentation fixup, style fixes (Ville)
v4: Clarify usage of intel_connector_free, and fix usage of
intel_connector_free
v5: Rebase
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: James Ausmus <james.ausmus@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171013180144.15865-1-james.ausmus@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 9c5b489a1f63..3f38be07ee9c 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6139,6 +6139,19 @@ struct intel_connector *intel_connector_alloc(void) return connector; } +/* + * Free the bits allocated by intel_connector_alloc. + * This should only be used after intel_connector_alloc has returned + * successfully, and before drm_connector_init returns successfully. + * Otherwise the destroy callbacks for the connector and the state should + * take care of proper cleanup/free + */ +void intel_connector_free(struct intel_connector *connector) +{ + kfree(to_intel_digital_connector_state(connector->base.state)); + kfree(connector); +} + /* Simple connector->get_hw_state implementation for encoders that support only * one connector and no cloning and hence the encoder state determines the state * of the connector. */ |