summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-06-21 19:08:08 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-10 03:45:36 +0400
commit6d827fbcc370ca259a2905309f64161ab7b10596 (patch)
treea9f92ac3d796ca010b7d9bcb7c1b5d8a0ef8da3f /drivers/char
parent9bd2d0dfe4714dd5d7c09a93a5c9ea9e14ceb3fc (diff)
downloadlinux-6d827fbcc370ca259a2905309f64161ab7b10596.tar.xz
i8k: Fix non-SMP operation
Commit f36fdb9f0266 (i8k: Force SMM to run on CPU 0) adds support for multi-core CPUs to the driver. Unfortunately, that causes it to fail loading if compiled without SMP support, at least on 32 bit kernels. Kernel log shows "i8k: unable to get SMM Dell signature", and function i8k_smm is found to return -EINVAL. Testing revealed that the culprit is the missing return value check of set_cpus_allowed_ptr. Fixes: f36fdb9f0266 (i8k: Force SMM to run on CPU 0) Reported-by: Jim Bos <jim876@xs4all.nl> Tested-by: Jim Bos <jim876@xs4all.nl> Cc: stable@vger.kernel.org # 3.14+ Signed-off-by: Guenter Roeck <linux@roeck-us.net> Cc: Andreas Mohr <andi@lisas.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/i8k.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
index d915707d2ba1..93dcad0c1cbe 100644
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -138,7 +138,9 @@ static int i8k_smm(struct smm_regs *regs)
if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
return -ENOMEM;
cpumask_copy(old_mask, &current->cpus_allowed);
- set_cpus_allowed_ptr(current, cpumask_of(0));
+ rc = set_cpus_allowed_ptr(current, cpumask_of(0));
+ if (rc)
+ goto out;
if (smp_processor_id() != 0) {
rc = -EBUSY;
goto out;