[PATCH OLK-6.6] drm: bridge: cdns-mhdp8546: Fix missing mutex unlock on error path

Offering: HULK hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICU97Y ------------------ In cdns_mhdp_atomic_enable(), there is an error return on failure of drm_mode_duplicate() which leads to the mutex remaining locked. Add a mutex unlock call. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 935a92a1c400 ("drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference") Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru> Signed-off-by: Qi Xi <xiqi2@huawei.com> --- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c index 858f5b650849..bdb9fc00c776 100644 --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c @@ -2057,8 +2057,10 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge, mhdp_state = to_cdns_mhdp_bridge_state(new_state); mhdp_state->current_mode = drm_mode_duplicate(bridge->dev, mode); - if (!mhdp_state->current_mode) - return; + if (!mhdp_state->current_mode) { + ret = -EINVAL; + goto out; + } drm_mode_set_name(mhdp_state->current_mode); -- 2.33.0

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/17656 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/VQ3... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/17656 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/VQ3...
participants (2)
-
patchwork bot
-
Qi Xi