iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 26 Nov 2021 13:55:55 +0000 (21:55 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:40:15 +0000 (09:40 +0100)
commit6ac2adcc2bffdf28aa1d397481d4149c59bc4786
tree13d532affdbc730beb25c349c3303e81d524d7b5
parent26f8b1ef30f6f077b477f965008fad39f22411f9
iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock()

commit 4e5973dd2725bb30c3db622f7d73f7a5864ce718 upstream.

If we return -EOPNOTSUPP, the rcu lock remains lock. This is spurious.
Go through the end of the function instead. This way, the missing
'rcu_read_unlock()' is called.

Fixes: 7afd7f6aa21a ("iommu/vt-d: Check FL and SL capability sanity in scalable mode")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/40cc077ca5f543614eab2a10e84d29dd190273f6.1636217517.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/20211126135556.397932-2-baolu.lu@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/intel/cap_audit.c