Commit da946589 authored by Gwendal Grignou's avatar Gwendal Grignou Committed by Enric Balletbo i Serra

platform/chrome: cros_ec: Do not attempt to register a non-positive IRQ number

Add a layer of sanity checking to cros_ec_register against attempting to
register IRQ values that are not strictly greater than 0.
Signed-off-by: default avatarEnrico Granata <egranata@chromium.org>
Signed-off-by: default avatarGwendal Grignou <gwendal@chromium.org>
Acked-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
parent 05a3c420
......@@ -149,7 +149,7 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
return err;
}
if (ec_dev->irq) {
if (ec_dev->irq > 0) {
err = devm_request_threaded_irq(dev, ec_dev->irq,
ec_irq_handler,
ec_irq_thread,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment