Skip to content

Commit 044262c

Browse files
jithu83gregkh
authored andcommitted
platform/x86/intel/ifs: release cpus_read_lock()
commit 2545deb upstream. Couple of error paths in do_core_test() was returning directly without doing a necessary cpus_read_unlock(). Following lockdep warning was observed when exercising these scenarios with PROVE_RAW_LOCK_NESTING enabled: [ 139.304775] ================================================ [ 139.311185] WARNING: lock held when returning to user space! [ 139.317593] 6.6.0-rc2ifs01+ #11 Tainted: G S W I [ 139.324499] ------------------------------------------------ [ 139.330908] bash/11476 is leaving the kernel with locks still held! [ 139.338000] 1 lock held by bash/11476: [ 139.342262] #0: ffffffffaa26c930 (cpu_hotplug_lock){++++}-{0:0}, at: do_core_test+0x35/0x1c0 [intel_ifs] Fix the flow so that all scenarios release the lock prior to returning from the function. Fixes: 5210fb4 ("platform/x86/intel/ifs: Sysfs interface for Array BIST") Cc: [email protected] Signed-off-by: Jithu Joseph <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a93a2c7 commit 044262c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/platform/x86/intel/ifs/runtest.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,15 @@ int do_core_test(int cpu, struct device *dev)
331331
switch (test->test_num) {
332332
case IFS_TYPE_SAF:
333333
if (!ifsd->loaded)
334-
return -EPERM;
335-
ifs_test_core(cpu, dev);
334+
ret = -EPERM;
335+
else
336+
ifs_test_core(cpu, dev);
336337
break;
337338
case IFS_TYPE_ARRAY_BIST:
338339
ifs_array_test_core(cpu, dev);
339340
break;
340341
default:
341-
return -EINVAL;
342+
ret = -EINVAL;
342343
}
343344
out:
344345
cpus_read_unlock();

0 commit comments

Comments
 (0)