]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i3c: master: svc: Use readsb helper for reading MDB
authorStanley Chu <yschu@nuvoton.com>
Tue, 18 Mar 2025 05:36:05 +0000 (13:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Apr 2025 08:45:28 +0000 (10:45 +0200)
commitc3250bdf5da9792a98be8c7c25f6814862790c3f
tree998abf514495bafe16577eec8020a9fb63edc51a
parentb00b040abfbbe227f2b8b6bdb0c825ced8afaccc
i3c: master: svc: Use readsb helper for reading MDB

commit c06acf7143bddaa3c0f7bedd8b99e48f6acb85c3 upstream.

The target can send the MDB byte followed by additional data bytes.
The readl on MRDATAB reads one actual byte, but the readsl advances
the destination pointer by 4 bytes. This causes the subsequent payload
to be copied to wrong position in the destination buffer.

Cc: stable@kernel.org
Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver")
Signed-off-by: Stanley Chu <yschu@nuvoton.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250318053606.3087121-3-yschu@nuvoton.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i3c/master/svc-i3c-master.c