]> git.hungrycats.org Git - linux/commit
char: xillybus: Fix trivial bug with mutex
authorEli Billauer <eli.billauer@gmail.com>
Thu, 17 Nov 2022 07:18:25 +0000 (09:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Nov 2024 14:37:35 +0000 (15:37 +0100)
commit9b242c4232af20897e1eddea4836e66af36e51ce
tree9889bbc9975cfef173873173c37e3f7d772cb16b
parent00baca74fb5879e5f9034b6156671301f500f8ee
char: xillybus: Fix trivial bug with mutex

commit c002f04c0bc79ec00d4beb75fb631d5bf37419bd upstream.

@unit_mutex protects @unit from being freed, so obviously it should be
released after @unit is used, and not before.

This is a follow-up to commit 282a4b71816b ("char: xillybus: Prevent
use-after-free due to race condition") which ensures, among others, the
protection of @private_data after @unit_mutex has been released.

Reported-by: Hyunwoo Kim <imv4bel@gmail.com>
Signed-off-by: Eli Billauer <eli.billauer@gmail.com>
Link: https://lore.kernel.org/r/20221117071825.3942-1-eli.billauer@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/xillybus/xillybus_class.c