Skip to content

Commit f18f981

Browse files
jamieilesalexandrebelloni
authored andcommitted
i3c: fix incorrect address slot lookup on 64-bit
The address slot bitmap is an array of unsigned long's which are the same size as an int on 32-bit platforms but not 64-bit. Loading the bitmap into an int could result in the incorrect status being returned for a slot and slots being reported as the wrong status. Fixes: 3a379bb ("i3c: Add core I3C infrastructure") Cc: Boris Brezillon <[email protected]> Cc: Alexandre Belloni <[email protected]> Signed-off-by: Jamie Iles <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 313ece2 commit f18f981

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/i3c/master.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ struct bus_type i3c_bus_type = {
343343
static enum i3c_addr_slot_status
344344
i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr)
345345
{
346-
int status, bitpos = addr * 2;
346+
unsigned long status;
347+
int bitpos = addr * 2;
347348

348349
if (addr > I2C_MAX_ADDR)
349350
return I3C_ADDR_SLOT_RSVD;

0 commit comments

Comments
 (0)