From d0aa54a0d4ea6a5829f72c5d8e83be3a2600deca Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Mon, 8 Oct 2007 04:15:16 +0000 Subject: 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. --- sys/dev/ipmi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sys/dev/ipmi.c') 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; -- cgit v1.2.3