summaryrefslogtreecommitdiff
path: root/sys/dev/ipmi.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-08 04:15:16 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-08 04:15:16 +0000
commitd0aa54a0d4ea6a5829f72c5d8e83be3a2600deca (patch)
tree00047cb58ad4a4453db399c255919b5bd3fad9b7 /sys/dev/ipmi.c
parent5fe5ffe7fab12d593fcc5f9f1fe293422159975c (diff)
More simple memset(,0,) -> M_ZERO changes. In this batch move to
size(*p) as the first malloc() parameter where p is declared locally and thus easy to check. Add M_ZERO to gpe_table allocation in acpi.c even though there is no obvious bzero or memset nearby.
Diffstat (limited to 'sys/dev/ipmi.c')
-rw-r--r--sys/dev/ipmi.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/ipmi.c b/sys/dev/ipmi.c
index d83e4edacb4..b5ef4e256bb 100644
--- a/sys/dev/ipmi.c
+++ b/sys/dev/ipmi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipmi.c,v 1.59 2007/08/31 18:44:50 marco Exp $ */
+/* $OpenBSD: ipmi.c,v 1.60 2007/10/08 04:15:15 krw Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave
@@ -1484,13 +1484,11 @@ add_child_sensors(struct ipmi_softc *sc, u_int8_t *psdr, int count,
return 0;
}
for (idx = 0; idx < count; idx++) {
- psensor = malloc(sizeof(struct ipmi_sensor), M_DEVBUF,
- M_NOWAIT|M_CANFAIL);
+ psensor = malloc(sizeof(*psensor), M_DEVBUF,
+ M_NOWAIT | M_CANFAIL | M_ZERO);
if (psensor == NULL)
break;
- memset(psensor, 0, sizeof(struct ipmi_sensor));
-
/* Initialize BSD Sensor info */
psensor->i_sdr = psdr;
psensor->i_num = sensor_num + idx;