]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dibs: initialise dibs->lock in dibs_dev_alloc()
authorHidayath Khan <hidayath@linux.ibm.com>
Thu, 30 Jul 2026 12:42:27 +0000 (14:42 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 6 Aug 2026 00:41:38 +0000 (17:41 -0700)
commitc27e360545373b7aee9862a5beef3b9fb3df0c25
tree333331aed5179fe85539c87ab2c9832c7be6a942
parent8ae344eb540af3f457179b52bc6061416752485c
dibs: initialise dibs->lock in dibs_dev_alloc()

dibs->lock is initialised by dibs_dev_add(), but a dibs device can
already take interrupts before that call: ism_probe() runs
ism_dev_init(), and hence request_irq(), before it calls
dibs_dev_add(). No client can have registered a dmb at that point, so
no dmb interrupt can occur, but a GID event interrupt can, and
ism_handle_irq() takes dibs->lock unconditionally on entry, before it
inspects anything else.

Initialise the lock in dibs_dev_alloc() instead, so that it is valid as
soon as a driver can publish the device to its interrupt handler.

Fixes: cc21191b584c ("dibs: Move data path to dibs layer")
Cc: stable@vger.kernel.org
Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
Signed-off-by: Hidayath Khan <hidayath@linux.ibm.com>
Link: https://patch.msgid.link/20260730124227.167829-1-hidayath@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dibs/dibs_main.c
include/linux/dibs.h