diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-03-13 22:54:11 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-03-13 22:54:13 +0100 |
commit | f64bcd88f5cc9e44573c202daf3c0dcec199636b (patch) | |
tree | 8d8b8661ee3f9c4beaab0e700ba1cf7027e9a8f6 /device | |
parent | 31165a8f1b00628b9c69b98b003fb3006b511ef6 (diff) | |
download | gnumach-f64bcd88f5cc9e44573c202daf3c0dcec199636b.tar.gz gnumach-f64bcd88f5cc9e44573c202daf3c0dcec199636b.tar.bz2 gnumach-f64bcd88f5cc9e44573c202daf3c0dcec199636b.zip |
device intr: Return an error on bogus intr port
Rather than risking dereferencing NULL.
Diffstat (limited to 'device')
-rw-r--r-- | device/intr.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/device/intr.c b/device/intr.c index 48812d73..2298d1bb 100644 --- a/device/intr.c +++ b/device/intr.c @@ -60,7 +60,10 @@ irq_acknowledge (ipc_port_t receive_port) e = search_intr (&irqtab, receive_port); if (!e) - printf("didn't find user intr for interrupt !?\n"); + { + printf("didn't find user intr for interrupt !?\n"); + ret = KERN_INVALID_ARGUMENT; + } else { if (!e->n_unacked) @@ -73,8 +76,7 @@ irq_acknowledge (ipc_port_t receive_port) if (ret) return ret; - if (e && irqtab.irqdev_ack) - (*(irqtab.irqdev_ack)) (&irqtab, e->id); + (*(irqtab.irqdev_ack)) (&irqtab, e->id); __enable_irq (irqtab.irq[e->id]); |