]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: mux: demux-pinctrl: check initial mux selection, too
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 15 Jan 2025 07:29:45 +0000 (08:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 1 Feb 2025 17:22:28 +0000 (18:22 +0100)
[ Upstream commit ca89f73394daf92779ddaa37b42956f4953f3941 ]

When misconfigured, the initial setup of the current mux channel can
fail, too. It must be checked as well.

Fixes: 50a5ba876908 ("i2c: mux: demux-pinctrl: add driver")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/muxes/i2c-demux-pinctrl.c

index 45a3f7e7b3f68e45c3d98e11896e616ca5c65fcb..cea057704c00c673fb5f0fd62c4441bfa5bb43f9 100644 (file)
@@ -261,7 +261,9 @@ static int i2c_demux_pinctrl_probe(struct platform_device *pdev)
        pm_runtime_no_callbacks(&pdev->dev);
 
        /* switch to first parent as active master */
-       i2c_demux_activate_master(priv, 0);
+       err = i2c_demux_activate_master(priv, 0);
+       if (err)
+               goto err_rollback;
 
        err = device_create_file(&pdev->dev, &dev_attr_available_masters);
        if (err)