[Intel-gfx] [PATCH] drm/i915: propagate errors from intel_dp_init_connector
Chris Wilson
chris at chris-wilson.co.uk
Mon Jun 10 21:59:26 CEST 2013
On Mon, Jun 10, 2013 at 02:19:45PM -0300, Paulo Zanoni wrote:
> - intel_dp_init_connector(intel_dig_port, dp_connector);
> + /* May fail if it's an eDP connector that's disconnected. */
> + if (!intel_dp_init_connector(intel_dig_port, dp_connector)) {
> + intel_ddi_destroy(encoder);
> + intel_dp_destroy(&dp_connector->base);
> + return;
> + }
You should not need to export intel_dp_destroy() ever. Better would be
for init to undo anything it allocates upon failure and here we just
kfree(dp_connector). In particular, intel_dp_destroy() is wrong here as
you have no idea if init returned at an appropriate juntion to make
calling that function safe.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list