From: Gwendal Grignou Date: Tue, 19 Nov 2019 12:45:46 +0000 (+0100) Subject: platform/chrome: cros_ec: Do not attempt to register a non-positive IRQ number X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=da946589b1b9b643c538e6c977ac0f963362ee3c;p=openwrt%2Fstaging%2Fblogic.git 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: Enrico Granata Signed-off-by: Gwendal Grignou Acked-by: Jonathan Cameron Acked-by: Lee Jones Signed-off-by: Enric Balletbo i Serra --- diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index 925f84dbf621..d3dfa27171e6 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -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,