projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7ff3cf
)
iommu/vt-d: Fix an unbalanced rcu_read_lock/rcu_read_unlock()
author
Christophe JAILLET
<christophe.jaillet@wanadoo.fr>
Fri, 26 Nov 2021 13:55:55 +0000
(21:55 +0800)
committer
Joerg Roedel
<jroedel@suse.de>
Fri, 26 Nov 2021 21:54:47 +0000
(22:54 +0100)
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>
drivers/iommu/intel/cap_audit.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/intel/cap_audit.c
b/drivers/iommu/intel/cap_audit.c
index b39d223926a491cd26db5f9573bb1b9b1614ca22..71596fc62822c36d76a8f7ac4c9232b96e5bc6cc 100644
(file)
--- a/
drivers/iommu/intel/cap_audit.c
+++ b/
drivers/iommu/intel/cap_audit.c
@@
-144,6
+144,7
@@
static int cap_audit_static(struct intel_iommu *iommu, enum cap_audit_type type)
{
struct dmar_drhd_unit *d;
struct intel_iommu *i;
+ int rc = 0;
rcu_read_lock();
if (list_empty(&dmar_drhd_units))
@@
-169,11
+170,11
@@
static int cap_audit_static(struct intel_iommu *iommu, enum cap_audit_type type)
*/
if (intel_cap_smts_sanity() &&
!intel_cap_flts_sanity() && !intel_cap_slts_sanity())
- r
eturn
-EOPNOTSUPP;
+ r
c =
-EOPNOTSUPP;
out:
rcu_read_unlock();
- return
0
;
+ return
rc
;
}
int intel_cap_audit(enum cap_audit_type type, struct intel_iommu *iommu)