drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()
authorHangyu Hua <hbh25y@gmail.com>
Fri, 24 Jun 2022 13:04:06 +0000 (06:04 -0700)
committerJosé Roberto de Souza <jose.souza@intel.com>
Tue, 28 Jun 2022 13:13:04 +0000 (06:13 -0700)
commitcea9ed611e85d36a05db52b6457bf584b7d969e2
tree0aa43d9a675ebea7ba5c537df6982ad224b4c8b7
parent9569ff1a188fe48b46eb1ac2ae4543c271e0d4c2
drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()

If drm_connector_init fails, intel_connector_free will be called to take
care of proper free. So it is necessary to drop the refcount of port
before intel_connector_free.

Fixes: 091a4f91942a ("drm/i915: Handle drm-layer errors in intel_dp_add_mst_connector")
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220624130406.17996-1-jose.souza@intel.com
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
drivers/gpu/drm/i915/display/intel_dp_mst.c