Propagate connector init errors from
intel_ddi_init_hdmi_connector(). The caller already handles the
allocation failures, and this is all similar to
intel_ddi_init_dp_connector().

Cc: Sergey Senozhatsky <[email protected]>
Cc: Ville Syrjala <[email protected]>
Reported-and-tested-by: Sergey Senozhatsky <[email protected]>
Closes: 
https://lore.kernel.org/r/[email protected]
Reviewed-by: Sergey Senozhatsky <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c 
b/drivers/gpu/drm/i915/display/intel_ddi.c
index 4f9c50996446..67bbfba58b54 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -4759,7 +4759,11 @@ intel_ddi_init_hdmi_connector(struct intel_digital_port 
*dig_port)
                return NULL;
 
        dig_port->hdmi.hdmi_reg = DDI_BUF_CTL(port);
-       intel_hdmi_init_connector(dig_port, connector);
+
+       if (!intel_hdmi_init_connector(dig_port, connector)) {
+               kfree(connector);
+               return NULL;
+       }
 
        return connector;
 }
-- 
2.39.5

Reply via email to