Commit 791daaf3 authored by Sunil V L's avatar Sunil V L Committed by Zhang Changzhong
Browse files

ACPI: irq: Fix incorrect return value in acpi_register_gsi()

stable inclusion
from stable-v4.19.297
commit 3ed90437a117336d7e6858d0464d7c2953868778
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8MCB5
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3ed90437a117336d7e6858d0464d7c2953868778



--------------------------------

commit 0c21a18d upstream.

acpi_register_gsi() should return a negative value in case of failure.

Currently, it returns the return value from irq_create_fwspec_mapping().
However, irq_create_fwspec_mapping() returns 0 for failure. Fix the
issue by returning -EINVAL if irq_create_fwspec_mapping() returns zero.

Fixes: d44fa3d4 ("ACPI: Add support for ResourceSource/IRQ domain mapping")
Cc: 4.11+ <stable@vger.kernel.org> # 4.11+
Signed-off-by: default avatarSunil V L <sunilvl@ventanamicro.com>
[ rjw: Rename a new local variable ]
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parent b83d3243
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment