From c31709835d764b0d04ae5e93159494f65427c697 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 16 Apr 2010 01:10:20 +0000 Subject: 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 --- sys/dev/ic/mpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/dev') 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 @@ -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); -- cgit v1.2.3