From 33bb2c4f88818cf236e2caa3a9c62b4ee90aba05 Mon Sep 17 00:00:00 2001 From: bouyer Date: Thu, 26 Sep 2019 08:16:26 +0000 Subject: Abort attach if acpi_intr_establish() fails. From K. Schreiner on current-users@. --- sys/dev/i2c/ihidev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/i2c/ihidev.c b/sys/dev/i2c/ihidev.c index 1e095629579..0f2b4ad62a5 100644 --- a/sys/dev/i2c/ihidev.c +++ b/sys/dev/i2c/ihidev.c @@ -1,4 +1,4 @@ -/* $NetBSD: ihidev.c,v 1.7 2018/11/16 23:05:50 jmcneill Exp $ */ +/* $NetBSD: ihidev.c,v 1.8 2019/09/26 08:16:26 bouyer Exp $ */ /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */ /*- @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.7 2018/11/16 23:05:50 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.8 2019/09/26 08:16:26 bouyer Exp $"); #include #include @@ -210,8 +210,10 @@ ihidev_attach(device_t parent, device_t self, void *aux) sc->sc_ih = acpi_intr_establish(self, sc->sc_phandle, IPL_TTY, false, ihidev_intr, sc, device_xname(self)); - if (sc->sc_ih == NULL) + if (sc->sc_ih == NULL) { aprint_error_dev(self, "can't establish interrupt\n"); + return; + } aprint_normal_dev(self, "interrupting at %s\n", acpi_intr_string(sc->sc_ih, buf, sizeof(buf))); } -- cgit