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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:24:18 +0000 (21:24 +0200)
commit505114dda5bbfd07f4ce9a2df5b7d8ef5f2a1218
treea9b7866ec2a8f5c1d679e144951a0c7fce2425be
parentc6e1c5c0c19da31ae3f6581b7dccf5668d75c156
drm/i915: fix a possible refcount leak in intel_dp_add_mst_connector()

[ Upstream commit 85144df9ff4652816448369de76897c57cbb1b93 ]

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>
(cherry picked from commit cea9ed611e85d36a05db52b6457bf584b7d969e2)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i915/display/intel_dp_mst.c