summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/devices.c
diff options
context:
space:
mode:
authordd <dd@FreeBSD.org>2001-07-02 00:18:04 +0000
committerdd <dd@FreeBSD.org>2001-07-02 00:18:04 +0000
commit4a798fb83a60241d607536db8b69d9709995a803 (patch)
treeeb3e6d3ae80fce772bbe283df44e815263d1b83f /usr.sbin/sade/devices.c
parentb1763d41ddf8b57a46b69e3e8423b9d57392bd6a (diff)
downloadFreeBSD-src-4a798fb83a60241d607536db8b69d9709995a803.zip
FreeBSD-src-4a798fb83a60241d607536db8b69d9709995a803.tar.gz
Introduce DEVICE_INIT, DEVICE_GET, and DEVICE_SHUTDOWN macros. As the
names suggest, they perform methods on Device's. In addition, they check that the pointer passed to them is valid; if it isn't, they pretend that the action failed. This fixes some crashes due to NULL dereferences (e.g., PR 26509). Approved by: jkh (some time ago)
Diffstat (limited to 'usr.sbin/sade/devices.c')
-rw-r--r--usr.sbin/sade/devices.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c
index 484a3d6..aa98bd0 100644
--- a/usr.sbin/sade/devices.c
+++ b/usr.sbin/sade/devices.c
@@ -236,7 +236,7 @@ deviceReset(void)
int i;
for (i = 0; i < numDevs; i++) {
- Devices[i]->shutdown(Devices[i]);
+ DEVICE_SHUTDOWN(Devices[i]);
/* XXX this potentially leaks Devices[i]->private if it's being
* used to point to something dynamic, but you're not supposed
OpenPOWER on IntegriCloud