diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-04-16 01:10:20 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2010-04-16 01:10:20 +0000 |
commit | c31709835d764b0d04ae5e93159494f65427c697 (patch) | |
tree | e8975263eb2129c6f4c369f17008f305fd3f83ce /sys | |
parent | d368f30d348bbc30885ecacc3865dcaa1cb5928b (diff) |
if there is no raid, do not allocate a 0-sized structure for sensors
and then start attaching it with 0 sensors attached
ok dlg
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/mpi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c index 8e940745b2a..6575612ebc1 100644 --- a/sys/dev/ic/mpi.c +++ b/sys/dev/ic/mpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpi.c,v 1.140 2010/04/12 09:53:46 dlg Exp $ */ +/* $OpenBSD: mpi.c,v 1.141 2010/04/16 01:10:19 deraadt Exp $ */ /* * Copyright (c) 2005, 2006, 2009 David Gwynne <dlg@openbsd.org> @@ -3017,6 +3017,8 @@ mpi_create_sensors(struct mpi_softc *sc) vol++; } + if (vol == 0) + return (0); sc->sc_sensors = malloc(sizeof(struct ksensor) * vol, M_DEVBUF, M_WAITOK|M_ZERO); |