]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i3c: master: svc: Recycle unused IBI slot
authorStanley Chu <stanley.chuys@gmail.com>
Fri, 29 Aug 2025 01:23:09 +0000 (09:23 +0800)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 16 Sep 2025 15:06:43 +0000 (17:06 +0200)
In svc_i3c_master_handle_ibi(), an IBI slot is fetched from the pool
to store the IBI payload. However, when an error condition is encountered,
the function returns without recycling the IBI slot, resulting in an IBI
slot leak.

Fixes: c85e209b799f ("i3c: master: svc: fix ibi may not return mandatory data byte")
Signed-off-by: Stanley Chu <yschu@nuvoton.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250829012309.3562585-3-yschu@nuvoton.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/i3c/master/svc-i3c-master.c

index 8e7b4ab919e3daa17aac213ba8b3fe5d0fa76416..9641e66a4e5f2da3bd84b30fa741e5e19d87465d 100644 (file)
@@ -417,6 +417,7 @@ static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master,
                                                SVC_I3C_MSTATUS_COMPLETE(val), 0, 1000);
        if (ret) {
                dev_err(master->dev, "Timeout when polling for COMPLETE\n");
+               i3c_generic_ibi_recycle_slot(data->ibi_pool, slot);
                return ret;
        }