diff options
author | phk <phk@FreeBSD.org> | 2002-04-23 15:48:23 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-04-23 15:48:23 +0000 |
commit | bf5ba9f42b8f3260b3890c6577b0d8767b20c9e8 (patch) | |
tree | bf14f808043a116b7087c3fdc213a7b61e2cae80 /sys/kern | |
parent | c1a2241009bf9d0e8d9c3d4e4276bbce0f2b5a47 (diff) | |
download | FreeBSD-src-bf5ba9f42b8f3260b3890c6577b0d8767b20c9e8.zip FreeBSD-src-bf5ba9f42b8f3260b3890c6577b0d8767b20c9e8.tar.gz |
Don't call malloc(9) to allocate zero bytes softc data for devices.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 7026ae5..7281051 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -997,7 +997,7 @@ device_set_driver(device_t dev, driver_t *driver) dev->driver = driver; if (driver) { kobj_init((kobj_t) dev, (kobj_class_t) driver); - if (!(dev->flags & DF_EXTERNALSOFTC)) { + if (!(dev->flags & DF_EXTERNALSOFTC) && driver->size > 0) { dev->softc = malloc(driver->size, M_BUS, M_NOWAIT | M_ZERO); if (!dev->softc) { |