]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i3c: Fix a shift wrap bug in i3c_bus_set_addr_slot_status()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 23 Apr 2019 10:40:20 +0000 (13:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 May 2019 05:49:56 +0000 (07:49 +0200)
commit3ae39e99e5395bee9dfa6796c2e2f125d96d0096
tree9ff987877c4b31f0ea3c159c75ebe549c8329db1
parentb8f93c2735218ec38a2e778128da844c811448ac
i3c: Fix a shift wrap bug in i3c_bus_set_addr_slot_status()

commit 476c7e1d34f2a03b1aa5a924c50703053fe5f77c upstream.

The problem here is that addr can be I3C_BROADCAST_ADDR (126).  That
means we're shifting by (126 * 2) % 64 which is 60.  The
I3C_ADDR_SLOT_STATUS_MASK is an enum which is an unsigned int in GCC
so shifts greater than 31 are undefined.

Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i3c/master.c