linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: cros_ec: Do not attempt to register a non-positive IRQ number
@ 2018-10-03 18:43 Enrico Granata
  0 siblings, 0 replies; only message in thread
From: Enrico Granata @ 2018-10-03 18:43 UTC (permalink / raw)
  To: Lee Jones, linux-kernel, gwendal; +Cc: Enrico Granata, Enrico Granata

From: Enrico Granata <egranata@chromium.org>

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 <egranata@google.com>
Signed-off-by: Enrico Granata <egranata@chromium.org>
---
 drivers/mfd/cros_ec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c
index 65a9757a6d21..d6b21e11cad6 100644
--- a/drivers/mfd/cros_ec.c
+++ b/drivers/mfd/cros_ec.c
@@ -118,7 +118,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, NULL,
 				ec_irq_thread, IRQF_TRIGGER_LOW | IRQF_ONESHOT,
 				"chromeos-ec", ec_dev);
-- 
2.19.0.605.g01d371f741-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-03 18:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-03 18:43 [PATCH 1/2] mfd: cros_ec: Do not attempt to register a non-positive IRQ number Enrico Granata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).