lkml.org 
[lkml]   [2014]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 58/94] i8k: Fix non-SMP operation
    Date
    From: Guenter Roeck <linux@roeck-us.net>

    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>
    Signed-off-by: sam-the-6 <asadi.samuel@gmail.com>
    ---
    drivers/char/i8k.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c
    index d915707..93dcad0 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;
    --
    1.7.10.4


    \
     
     \ /
      Last update: 2014-07-19 19:41    [W:4.124 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site