]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/rockchip: Fix an error handling path rockchip_dp_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 18 Jun 2022 17:08:05 +0000 (19:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:17:41 +0000 (11:17 +0200)
[ Upstream commit 107797b8b85571ec198af9ae96f0a4dcab227ba3 ]

Should component_add() fail, we should call analogix_dp_remove() in the
error handling path, as already done in the remove function.

Fixes: 52f8cb8e3123 ("drm/bridge: analogix_dp: Split bind() into probe() and real bind()")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/b719d9061bb97eb85145fbd3c5e63f4549f2e13e.1655572071.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c

index ce98c08aa8b446da487481ebf51a4f996a4efd77..48281e29b5d453774270569af9be0a642ed451b0 100644 (file)
@@ -401,7 +401,15 @@ static int rockchip_dp_probe(struct platform_device *pdev)
        if (IS_ERR(dp->adp))
                return PTR_ERR(dp->adp);
 
-       return component_add(dev, &rockchip_dp_component_ops);
+       ret = component_add(dev, &rockchip_dp_component_ops);
+       if (ret)
+               goto err_dp_remove;
+
+       return 0;
+
+err_dp_remove:
+       analogix_dp_remove(dp->adp);
+       return ret;
 }
 
 static int rockchip_dp_remove(struct platform_device *pdev)