]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
i3c: master: Update hot-join flag only on success
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 13 Jan 2026 07:26:44 +0000 (09:26 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 14 Jan 2026 16:21:09 +0000 (17:21 +0100)
To prevent inconsistent state when an error occurs, ensure the hot-join
flag is updated only when enabling or disabling hot-join succeeds.

Fixes: 317bacf960a48 ("i3c: master: add enable(disable) hot join in sys entry")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260113072702.16268-4-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master.c

index 3bc8b4abf8afe26455bfee3c0160cf2b464e68f7..d684a6b799603c3b752f2682db5f1c41f32ca564 100644 (file)
@@ -618,7 +618,8 @@ static int i3c_set_hotjoin(struct i3c_master_controller *master, bool enable)
        else
                ret = master->ops->disable_hotjoin(master);
 
-       master->hotjoin = enable;
+       if (!ret)
+               master->hotjoin = enable;
 
        i3c_bus_normaluse_unlock(&master->bus);