From ae73820125a27c770a216c852d7a27d7018fe9a4 Mon Sep 17 00:00:00 2001 From: cperciva Date: Sun, 22 Feb 2004 01:06:05 +0000 Subject: We want to allocate and zero sizeof(struct foo) bytes, not sizeof(struct foo *) bytes. Reported by: "Ted Unangst" Approved by: rwatson (mentor), scottl --- sys/dev/raidframe/rf_diskqueue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev/raidframe/rf_diskqueue.c') diff --git a/sys/dev/raidframe/rf_diskqueue.c b/sys/dev/raidframe/rf_diskqueue.c index bb1f01a..c03e6cd 100644 --- a/sys/dev/raidframe/rf_diskqueue.c +++ b/sys/dev/raidframe/rf_diskqueue.c @@ -157,11 +157,11 @@ init_dqd(dqd) RF_DiskQueueData_t *dqd; { - dqd->bp = (RF_Buf_t) malloc(sizeof(RF_Buf_t), M_RAIDFRAME, M_NOWAIT); + dqd->bp = (RF_Buf_t) malloc(sizeof(*dqd->bp), M_RAIDFRAME, M_NOWAIT); if (dqd->bp == NULL) { return (ENOMEM); } - memset(dqd->bp, 0, sizeof(RF_Buf_t)); /* if you don't do it, nobody + memset(dqd->bp, 0, sizeof(*dqd->bp)); /* if you don't do it, nobody * else will.. */ return (0); } -- cgit v1.1